In a paper titled General Theorems in Contour Integration with Some Applications, G.H. Hardy states the following:
Let us integrate
$$ (i) \ \int \frac{e^{ipz}}{(\cos z)^{a}} \frac{\mathrm dz}{z- \xi} \, , $$
$$ (ii) \ \int \frac{e^{ipz}}{(\sin z)^{a}} \frac{\mathrm dz}{z- \xi} \, , $$
round contours $K'$. For the present we suppose $\xi$ not real, and $a <1 ,0 < p + a$; $a$ may be negative. We begin with $(i)$, taking that value of $(\cos z)^{a}$ which is real at the origin.
As $z$ moves around any one of the points $ \left( n+\frac{1}{2} \right) \pi$, the subject of integration acquires a factor $e^{ ia \pi}$; and so the contribution of $\Xi$ is, in the limit,
$$ \sum_{n=-\infty}^{\infty} \int^{(n+\frac{1}{2})\pi}_{(n-\frac{1}{2}) \pi} \frac{e^{i(na \pi + p x)} }{|\cos x |^{a}} \frac{\mathrm dx}{x-\xi} \, ,$$
or $$\sum_{n=-\infty}^{\infty} \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \frac{e^{ipu}}{(\cos u)^{a}} \frac{e^{i n \pi(p+a)}}{u+n \pi - \xi} \, \mathrm du.$$
The contour $K'$ is a closed semicircle in the upper half-plane, and $\Xi$ is the part of the contour that lies just above the real axis.
Since $$ \frac{1}{(\cos z)^{a}} = \frac{e^{-ia \arg (\cos z)}}{|\cos z |^{a}} \, ,$$ Hardy seems to be saying that $\arg (\cos z) = - n \pi$ on $\Xi$ if $\Re(z) \in \Big( \left(n-\frac{1}{2}\right) \pi, \left(n+ \frac{1}{2} \right)\pi \Big)$.
How exactly is $\log (\cos z)$ being defined here?