Find $\int_{\gamma}\frac{dz}z$

$\gamma$ is a path from $i$ to $-i$, not necessarily a straight line which passes through $0$.

Since the image of $\gamma$ does not touch $\mathbb R^-$, it means that $\gamma$ cannot "turn around" $0$, so you can't really use the residue theorem because there are no residue in the inside of $\gamma$ (well $\gamma$ is not even a closed curve. But anyhow you can't close it such that $0$ is inside)

So any curve between those two points will result in the same integral.

How to do that? Well since we are on $\mathbb C - \mathbb R^-$, we have that $\log z$ is a holomorphic function (it's not multivalued anymore) and it's derivative is $\frac 1z$, we can use the usual formula;

The result depends only on the endpoints, and we get

$$\int_\gamma \frac 1z dz = \log(i) - \log(-i) =i \frac \pi2 - (-i\frac \pi2) = i\pi$$


Inasmuch as @Ant has already provided an efficient approach, it might be instructive to see a more "brute force" approach.

To that end we parameterize $z$ on $\gamma$ and let $z=x(t)+iy(t)$, $0\le t\le 1$, with $x(0)=x(1)=0$, $y(0)=-1$, and $y(1)=1$.

Thus, $dz=x'(t)dt+iy'(t)dt$ and the integral of interest becomes

$$\begin{align} \int_{\gamma}\frac{dz}{z}&=\int_{0}^1\frac{x(t)x'(t)+y(t)y'(t)}{x^2(t)+y^2(t)}dt+i\int_{0}^1\frac{x(t)y'(t)-y(t)x'(t)}{x(t)^2+y(t)^2}dt\\\\ &=\left. \frac12 \log(x^2(t)+y^2(t))\right|_{t=0}^{t=1}+i\,\left.\arctan\left(\frac{y(t)}{x(t)}\right)\right|_{t=0}^{t=1}\\\\ &=(0-0)+i(\pi/2-(-\pi/2))\\\\ &=i\pi \end{align}$$

as expected!


NOTE: For a more general development, see This Answer.