
i want to find $$\frac{1}{2\pi i}\int _\gamma \frac{1}{z}dz$$
well $0$'s winding number is $2$, so $\frac{1}{2\pi i}\int _\gamma \frac{1}{z}dz=2$
but when I explicity calculate the integral I get
$$\frac{1}{2\pi i}\int _\gamma \frac{1}{z}dz=\frac{1}{2\pi i}(\log(z)\lvert ^{z=-1}_{z=3}+\log(z)\lvert ^{z=\sqrt 2}_{z=-1}+\log(z)\lvert ^{z=-\sqrt 5}_{z=\sqrt 2}+\log(z)\lvert ^{z=3}_{z=-\sqrt 5})=\\ \frac{1}{2\pi i}(\log |-1|+i\pi-\log 3+\log \sqrt 2 -\log |-1|-i\pi+\log |-\sqrt 5|+i\pi-\log \sqrt 2 +\\+\log 3-\log |-\sqrt 5|-i\pi)=0$$
whats going on here?
The imaginary part of logarithm increases as you go around the origin.
It is the angle between z and the positive real axis.
As you go around from 3 to -1 to $\sqrt{2}$, that angle increases from 0 to $\pi$ to $2\pi$. So the imaginary part of $\log(\sqrt{2})$ is $2\pi$.
$\log x$ has lots of complex values, in the same way that $\sqrt{x}$ has two values. By following the path $\gamma$, you can follow which value is relevant to your problem.
Think of it like a multistory car-part. Going around the origin puts you on a different level.