loops – How can I find this code block’s execution time t(n) and big O notation?

Hello I am a CSE student and this question was in my homework.

double fact(long i)
{
if (i==1 || i==0) return i;
else return i*fact(i-1);
}

funcQ2()
{
for (i=1; i<=n; i++)
sum=sum+log(fact(i));
}

I thought it is O(n^2) but can the bottom function’s log function call make it O(n^3)? I am not sure

Thanks in advance