$\int_0^{2\pi} \log |1-w e^{i\theta}| \, d\theta$ 
Let $w$ be a complex number such that $|w| < 1$. Evaluate the integral
$$\int_0^{2\pi} \log |1-w e^{i\theta}| \, d\theta.$$

I am having a hard time moving forward on this question.
I tried substituting $z=e^{i\theta}$, and to get $$\oint_\gamma \frac{\log|1-wz|}{iz} \, dz,$$ where $\gamma$ is the unit circle with positive orientation.
Attempt 1: With this substitution, the integrand is not holomorphic, because multiplying by $iz$ (a holomorphic function), we get a purely real valued function (at least in some open set in the right half plane), which can only be holomorphic if it is constant, which this function is not. The strategies for contour integrals will probably not help me.
Attempt 2: I tried finding some symmetry (either antipodal point or point with equal imaginary part; horizontally across)  to cancel out the integral, but couldn't.
Attempt 3: After searching, I found this post on Math SE. The suggestion there is focus on the function $\log(1-wz)$ recognizing that the real part of this is $\log|1-wz|$ and either (1) "think mean value" or (2) differentiate this function. I don't know how it helps to observe that $\oint_\gamma \frac{1}{1-wz} dz = 0$. I appreciate any suggestion that will help me understand the hints (or another way to see that the integral is 0).
 A: It's not hard to see that the real part of $\log(1-wz)$ is $\log|1-wz|$. It takes one more step to see that the real part of the integral (not just the integrand) $\oint \frac{\log(1-wz)}{iz} dz$  is $\oint \frac{|\log(1-wz)|}{iz} dz$.
In the standard parameterization (i.e., $z = e^{i\theta}$) of the unit circle $\gamma$ with a real parameter, we have $\arg(dz) = \arg(z)+\frac{\pi}{2}$ and hence $\frac{dz}{iz}$ is real. Therefore, the real part of the integral $$\oint_\gamma \frac{\log(1-wz)}{iz} dz = \oint_\gamma \log(1-wz)\frac{dz}{iz}$$ is $$\oint_\gamma \frac{|\log(1-wz)|}{iz} dz.$$
There is an open set $\Omega$ containing the unit disk (i.e., simply connected open set containing $\gamma$) on which the integrand $\frac{|\log(1-wz)|}{iz}$ is holomorphic (the singularity is removable) and hence the integral is 0.
Therefore $$\oint \frac{|\log(1-wz)|}{iz} dz = 0.$$
A: If you set $w = a+\mathrm{i}b$, and write $e^{\mathrm{i}\theta}=\cos\theta+\mathrm{i}\sin\theta$, you have
$$
w e^{\mathrm{i}\theta}=(a+\mathrm{i}b)(\cos\theta+\mathrm{i}\sin\theta)=
a\cos\theta-b\sin\theta+\mathrm{i}(b\cos\theta+a\sin\theta)\ .
$$
Therefore
$$
|1-w e^{\mathrm{i}\theta}|=\sqrt{(1-a\cos\theta+b\sin\theta)^2+(b \cos\theta+a\sin\theta)^2}\ .
$$
Taking the log, we get
$$
\log|1-w e^{\mathrm{i}\theta}|=\frac{1}{2}\log\left(1+a^2+b^2-2 a \cos \theta +2 b \sin \theta \right)\ .
$$
Applying now the integral formula (see Gradshteyn and Ryzhik
Table of Integrals, Series, and Products, ed. 1996, formula 4.225.4)
$$
\int_0^{2\pi}dx\ln (1+a^2+b^2+2 a \sin x+2 b \cos x)=0\mbox{ if }a^2+b^2\leq 1\mbox{ and }2\pi\ln (a^2+b^2)\mbox{ if }a^2+b^2\geq 1
$$
one has immediately that the requested integral is zero (for $|w|\leq 1$) and equal to
$$
\int_0^{2\pi}\log|1-w e^{\mathrm{i}\theta}|=2\pi\log |w|\ ,
$$
for $|w|>1$.
