Assume that $a\in\mathbb{R}$. Then, observing that $|1-ae^{-iw}|=\sqrt{1+a^2-2a\cos(w)}$ is $2\pi$-periodic and even in $w$, we find that
$$\begin{align}
\int_0^\pi \log\left(|1-ae^{-iw}|\right)\,dw&=\frac12 \int_0^{2\pi}\log\left(\sqrt{1+a^2-2a\cos(w)}\right)\,dw\\\\
&=\frac12 \int_0^{2\pi}\log\left(\sqrt{1+a^2+2a\cos(w)}\right)\,dw\\\\
&\overbrace{=}^{z=e^{iw}}\frac12 \oint_{|z|=1} \frac{\log\left(|z-a|\right)}{iz}\,dz\tag1
\end{align}$$
In addition, we see that
$$\int_0^\pi \log\left(|1-ae^{-iw}|\right)\,dw=\pi \log(|a|)+\frac12 \oint_{|z|=1} \frac{\log\left(|z-1/a|\right)}{iz}\,dz\tag2$$
It suffices, therefore, to assume that $a>1$.
Now, for $a>1$, let us evaluate the integral $I(a)$ given by
$$I(a)=\frac12\oint_{|z|=1}\frac{\log(z-a)}{iz}\,dz$$
Inasmuch as $\log(z-a)$ is analytic in and on $|z|=1$, the Residue Theorem guarantees that
$$I(a)=\pi \log(a)+i\pi^2\tag3$$
where we have chosen to cut the plane with a ray from $a$ and extending along the positive real axis such that $\log(1)=0$.
We also can write
$$\begin{align}
I(a)&=\frac12 \oint_{|z|=1}\frac{\log\left(|z-a|\right)}{iz}\,dz+\frac12 \oint_{|z|=1}\frac{\arg\left(z-a\right)}{z}\,dz\\\\
&= \int_0^\pi \log\left(|1-ae^{-iw}|\right)\,dw+\frac i2 \int_{-\pi}^\pi \left(\pi+\arctan\left(\frac{\sin(\phi)}{\cos(\phi)-a}\right)\right)\,d\phi\\\\
&= \int_0^\pi \log\left(|1-ae^{-iw}|\right)\,dw+i\pi^2\tag4
\end{align}$$
whence comparing $(3)$ and $(4)$ reveals
$$\int_0^\pi \log\left(|1-ae^{-iw}|\right)\,dw=\pi\log(a)$$
for $a>1$.
Using $(1)$, $(2)$ and $(4)$ we see that for $0<a<1$
$$\int_0^\pi \log\left(|1-ae^{-iw}|\right)\,dw=0$$
Putting everything together yields
$$\int_0^\pi \log\left(|1-ae^{-iw}|\right)\,dw=\begin{cases}\pi\log(|a|)&,|a|\ge 1\\\\
0&,|a|\le 1\end{cases}$$