Methods to calculate $\int_0^{2\pi}\frac{1}{1 - w e^{-it}}\,dt$ disagree I'm trying to evaluate the integral
$$\int_0^{2\pi}\frac{1}{1 - w e^{-it}}\,dt$$
where $w \in \mathbb{C}$, $|w|\ne1$.
Using antiderivatives I get:
$$\begin{align}
\int \frac{1}{1 - w e^{-it}}\,dt &= -i \int \frac{1}{u}\,du\\\\& = -i \log(u)\\\\& = -i \log(w - e^{it})
\end{align}$$
where $u = e^{it} - w$.  So, we have
$$\begin{align}
\int_0^{2\pi} \frac{1}{1 - w e^{-it}} \,dt&= -i (\log(w - e^{2i\pi}) - \log(w - e^{0i}))\\\\
&= -i (\log(w - 1) - \log(w - 1))\\\\
& = -i \log\left(\frac{w - 1}{w - 1}\right)\\\\
& = -i \log(1) \\\\
&= 0
\end{align}$$
But with a contour integral I get:
$$\begin{align}
\int_0^{2\pi} \frac{1}{1 - w e^{-it}}\,dt &= \oint_{|z| = 1} \frac{z}{z - w} \frac{1}{iz}\,dz\\\\
& = \frac{1}{i}\oint_{|z| = 1} \frac{1}{z - w}\,dz
\end{align}$$
This agrees with my antiderivative above if $|w| > 1$ since then the function is holomorphic in the unit circle (so its contour integral is just $0$), but if $|w| < 1$ there's a simple pole at $z = w$ so this should give $2 \pi$.
Obviously $2 \pi \neq 0$ so I made a mistake somewhere.  Which is correct, and what's the mistake I made in the wrong method?
 A: There are a few way to evaluate the integral given by
$$I=\int_0^{2\pi}\frac1{1-we^{-it}}\,dt\tag1$$
where $|w|\ne1$.

NOTE:  While the integral diverges when $|w|=1$, its Cauchy Principal Value exists.


METHODOLOGY $1$: Use of Cauchy's Integral Theorem
Perhaps the most efficient way to proceed is to let $z=e^{it}$ in $(1)$.  Then, Cauchy's Integral Theorem guarantees that
$$\begin{align}
I&=\oint_{|z|=1}\frac{1}{1-w/z}\frac1{iz}\,dz\\\\
&=\frac1i \oint_{|z|=1}\frac{1}{z-w}\,dz\\\\
&=\begin{cases}2\pi&,|w|<1\\\\0&,|w|>1\tag2
\end{cases}
\end{align}$$
And we are done.


METHODOLOGY $2$: Use of the complex logarithm
If we wish to proceed along an analogous line as in the OP, then we must be careful to define the complex logarithm appropriately.  First, we can assume that $w$ is real and non-negative without loss of generality.
To see this, note that the integrand in $(1)$ is $2\pi$-periodic.  Accordingly, we can write
$$\begin{align}
I&=\int_{\arg(w)}^{\arg(w)+2\pi}\frac1{1-we^{-it}}\,dt\\\\
&=\int_0^{2\pi}\frac{e^{it}}{e^{it}-|w|}\,dt
\end{align}$$

Next, we cut the $z$ plane from $|w|$ to the point at infinity along the positive real axis, then choose the branch for which
$$0\le \arg\left(e^{it}-|w|\right)<2\pi$$
With this choice of branch cut we see that the complex logarithm, $\log(z-|w|)$, is holomorphic for $|z|<|w|$.  And inasmuch as $|e^{it}|=1$, we can write for $|w|>1$
$$\begin{align}
\int_0^{2\pi}\frac{e^{it}}{e^{it}-|w|}\,dt&=\left.\left(\log\left(e^{it}-|w|\right)\right)\right|_0^{2\pi}\\\\
&=0
\end{align}$$

But when $|z|>|w|$, the complex logarithm, $\log(z-w)$, is discontinuous across the branch cut with $\log(e^{i2\pi^-}-|w|)-\log(e^{i0^+}-|w|)=i2\pi$.  Inasmuch as $|e^{it}|=1$, we can write for $|w|<1$
$$\begin{align}
\int_0^{2\pi}\frac{e^{it}}{e^{it}-|w|}\,dt&=\left.\left(\log\left(e^{it}-|w|\right)\right)\right|_{0^+}^{2\pi^-}\\\\
&=i2\pi
\end{align}$$
We conclude, therefore, that
$$\begin{align}
I&=\begin{cases}2\pi&,|w|<1\\\\0&,|w|>1
\end{cases}
\end{align}$$
which agrees with the result in $(2)$.
