How do you determine the angle of a branch cut in a composition of functions? Given $\int\log{\frac{a^2+z^2}{z^2}}e^{ivz}$dz

The integral along the branch cut from 0 to a and back:
$$\int_0^a\log(\lvert\frac{a^2+z^2}{z^2}\rvert)+i\pi$$
$$\int_a^0\log(\lvert\frac{a^2+z^2}{z^2}\rvert)-i\pi$$
How were the angle's $\pm\pi$ determined?
Was $\arg[1-(a/y)^2]$ calculated by picking an angle that was convenient to calculate or is there a unique value on the left and right for the branch cut?
A second example: 
Given $1/2\int\frac{e^{iwx}}{\sqrt{x^2+1}}$dz
On the right side of the branch cut: $\int_R^1\frac{e^{-wy}}{(\sqrt{y^2-1})i}$
On the left side of the branch cut: $\int_1^R\frac{e^{-wy}}{-(\sqrt{y^2-1})i}$
How were the signs determined in the denominator? Here it could be $e^{i\pi/2+in\pi}$ measured from the origin in the figure but I don't think that's how it was determined because the same reasoning doesn't work in the first example. 
 A: We are looking for expressions for the $\log(\frac{a^2+z^2}{z^2})$ inside the integral along the contour segments at the sides of the vertical branch cut that goes from $-ia$ to $ia$. Say the left segment is $C_1$ and the right segment is $C_2$ (both at the upper half plane). Then we have the following cases.
Segment $C_1$:
We select an arbitrary point $z=|z|e^{i\theta}$ of the segment $C_1$. The vectors that go from $ia$ and $-ia$ to $z$ form the corresponding complex numbers $(z-ia)=|z-ia|e^{i\theta_1}$ and $(z+ia)=|z+ia|e^{i\theta_2}$. Then we can write:
$$\frac{z^2+a^2}{z^2}=\frac{|z-ia|e^{i\theta_1}|z+ia|e^{i\theta_2}}{|z|^2e^{i2\theta}}=\frac{|z^2+a^2|}{|z|^2}e^{i(\theta_1+\theta_2-2\theta)}=\Big|\frac{z^2+a^2}{z^2}\Big|e^{i(\theta_1+\theta_2-2\theta)}$$

Now, as our segment $C_1$ approaches arbitrarily closer to the vertical branch, we have that:
$$\theta \to \frac{\pi}{2}, \theta_1 \to \frac{3\pi}{2}, \theta_2 \to \frac{\pi}{2}$$
Then:
$$\frac{z^2+a^2}{z^2}=\Big|\frac{z^2+a^2}{z^2}\Big|e^{i(\frac{3\pi}{2}+\frac{\pi}{2}-2\frac{\pi}{2})}=\Big|\frac{z^2+a^2}{z^2}\Big|e^{i\pi}$$
Therefore:
$$\log\Big(\frac{z^2+a^2}{z^2}\Big)=\log\Big|\frac{z^2+a^2}{z^2}\Big|+i\pi$$
Segment $C_2$:
The reasoning in this case is analogous to the previous one. With the difference now we have that, when the segment $C_2$ approaches the branch, the angles tend to:
$$\theta \to \frac{\pi}{2}, \theta_1 \to \frac{-\pi}{2}, \theta_2 \to \frac{\pi}{2}$$

Then:
$$\frac{z^2+a^2}{z^2}=\Big|\frac{z^2+a^2}{z^2}\Big|e^{i(-\frac{\pi}{2}+\frac{\pi}{2}-2\frac{\pi}{2})}=\Big|\frac{z^2+a^2}{z^2}\Big|e^{-i\pi}$$
Therefore:
$$\log\Big(\frac{z^2+a^2}{z^2}\Big)=\log\Big|\frac{z^2+a^2}{z^2}\Big|-i\pi$$
And that way we have determined the angles corresponding to a composite function at the path segments running along the branch cut.
