According to Cauchy's residue theorem:
If $U$ be a simply connected open subset of the complex plane containing a finite list of points $a_1, \ldots, a_n$ and f a function defined and holomorphic on $U -\{a_1, \ldots, a_n\}$. Let $γ$ be a closed rectifiable curve in $U$ which does not meet any of the $a_k$, and denote the winding number of $γ$ around $a_k$ by $I(γ, a_k)$. The line integral of $f$ around $γ$ is equal to $2πi$ times the sum of residues of $f$ at the points, each counted as many times as $γ$ winds around the point.
$$\oint_\gamma f(z) \, dz = 2\pi i \sum_{k=1}^{k=n} I(\gamma,a_k) \operatorname{Res}(f,a_k)$$
I understand Cauchy's residue theorem so far.
Now, my textbook "Topology and Geometry for Physicists" by Nash & Sen, says (on page 3): As a consequence of Cauchy's theorem for a meromorphic function $f(z)$ we have:
$$\frac 1 {2\pi i} \oint_C \frac{f'(z)}{f(z)} \, dz = n_0-n_p$$
where $n_0$ and $n_p$ are the number of zeroes and number of poles respectively of $f(z)$ lying inside $C$.
Now, I'm not sure how to extend Cauchy's residue theorem to get $\frac 1 {2\pi i} \oint_C \frac{f'(z)}{f(z)} \, dz = n_0-n_p$. Any suggestions?
It is straightforward to notice that the claim holds for functions of the form $(z-z_0)^m$ with $m\in\mathbb{Z}$. Additionally $\frac{f'(z)}{f(z)}=\frac{d}{dz}\log f(z)$, hence if $f(z) = g_1(z) g_2(z)\cdots g_T(z)$ we have
$$ \frac{1}{2\pi i}\oint \frac{f'(z)}{f(z)}\,dz = \sum_{k=1}^{T} \frac{1}{2\pi i}\oint \frac{g_k'(z)}{g_k(z)}\,dz.\qquad (\text{additivity of the winding number})$$
To finish the proof, it is enough to notice that if $g(z)$ is a holomorphic and non-vanishing function over the closure of some bounded, simply-connected set $V\subset\mathbb{C}$, then $\log g(z)$ and $\frac{g'(z)}{g(z)}$ are holomorphic as well, hence $$ \frac{1}{2\pi i}\oint \frac{g'(z)}{g(z)}\,dz = 0.$$