The Integral is $$\displaystyle \int_C \frac{(ln z)^2}{z^2+1}$$
The problem mentions only that the contour C covers all singularities.
This is obviously $2\pi i $ times the sum of the residues at $\pm i$:
$$\frac{(log \, i)^2}{2i}+\frac{(log (- i))^2}{-2i}$$
Now $log\, z$ is a multivalued function. So naively it would seem that the integral should also depend on the choice of branch cut. For instance if we choose the principal branch with $arg z \in (-\pi,\pi] $ then the integral vanishes. But were we to choose $arg z \in [0,2\pi) $ we would get a non zero result.
Is that correct? Is one of these choices more correct than the other?
Maybe this helps?
$\log(z)$ as a multivalued function on the domain $\mathbb{C}-0$:
Hence
It works because if $z \, / \, |z| \ne \cos(a) + i \sin(a)$ then, for any choice of $\theta \in \arg(z)$, using the expression $\arg(z) = \{\theta + 2 n \pi \,\bigm|\, n \in \mathbb{Z}\}$, it follows that there exists a unique $n \in \mathbb{Z}$ such that $\theta + 2 n \pi \in (a,a+2\pi)$.