Let $U \subseteq \mathbb{C}$ be an open set and $f \,:\, U \to \mathbb{C}$ a holomorphic function, such that $$f(U) \subseteq\{r e^{it} \,:\, r > 0, -\pi < t < \pi\}.$$ I want to show that
$$\int_\gamma \frac{f'(z)}{f(z)} \mathrm{d}z = 0$$
for all closed smooth paths $\gamma$ in U.
Apparently, $f$ does not have any zeros in $U$ and the logarithmic derivative of $f$ should be holomorphic on $U$. However, I cannot use Cauchy's integral theorem since $U$ is no domain and $\gamma$ is not given as null-homotopic. Neither the residual theorem can be applied, which would yield a proof similar to this one.
Is there maybe a variant of the two mentioned theorems that I am missing? Do you have other suggestions?