I want to use contour integration to show that $$\int_{0}^{\infty} \frac{2 \cos (x) \log (x) + \pi \sin (x)}{x^2+4} \, \mathrm dx = \frac{\pi \log (2)}{2e^{2}}.$$
The recommendation in the textbook I'm reading is to integrate the function $$f(z) = \frac{e^{iz} \log(-iz)}{z^{2}+4}$$ around an indented contour that consists of the real axis from $-R$ to $R$, along with the upper half of the circle $|z|=R$.
The fact that $f(z)$ involves $\log(-iz)$ and not simply $\log (z)$ makes me a bit uneasy.
I think we would want to place the branch cut along the negative imaginary axis so that it doesn't intersect the contour.
Would that mean $- \pi < \arg(-iz) \le \pi$?
EDIT:
I converted the rest of my question into an answer.
I think this is a bit backwards. If you want the branch cut to be downwards (-ve imaginary axis, located at $\arg z = -\pi/2,3\pi/2,\cdots$) then you want a $(-\pi/2,3\pi/2)$ range for $\arg z$, agreed.
Now the discontinuity is at $-i$. Hence $\arg(-iz)$ is discontinuous at $(-i)(-i)=-1$. Accordingly we will take a $(-\pi,\pi)$ type interval.
Your values are impossible, in that they are not a multiple of $2\pi$ out from the standard arguments.
You should be able to get the answer using these.