Proving $\int_0^{\pi} \frac{\log (1+r-2\sqrt{r}\cos(t))}{1+r-2\sqrt{r} \cos(t)}\,dt = \frac{2\pi}{1-r}\log(1-r)$, when $0 < r < 1$.
$$\begin{align} \int_{0}^{\pi} \frac{\log(1+r^{2}-2r \cos t)}{1+r^{2} - 2 r \cos t} \, \mathrm dt &= \frac{1}{2} \int_{-\pi}^{\pi} \frac{\log(1+r^{2}-2r \cos t)}{1+r^{2} - 2 r \cos t} \, \mathrm dt \\ &= \Re \int_{-\pi}^{\pi} \frac{\log(1-re^{it})}{(1-re^{it})(1-re^{-it})} \, \mathrm dt \\ &= \, \Re \int_{|z|=1} \frac{\log (1-rz)}{(1-rz)(1-r/z)} \, \frac{ \mathrm dz}{iz} \\ &= \, \Re \, \frac{1}{i} \int_{|z|=1} \frac{\log (1-rz)}{(1-rz)(z-r)} \, \mathrm dz \end{align}$$
Since $0 < r< 1$, the only singularity inside the unit circle is a simple pole at $z=r$.
Therefore,
$$ \begin{align} \int_{0}^{\pi} \frac{\log(1+r^{2}-2r \cos t)}{1+r^{2} - 2 r \cos t} \, \mathrm dt &= \Re\, \frac{1}{i}\, 2 \pi i \, \frac{\log(1-r^{2})}{1-r^{2}} \\ &= \frac{2 \pi}{1-r^{2}} \, \log(1-r^{2}) \end{align}$$
Let $s = \sqrt{r} \in (0,1)$. Our starting point is the geometric series $$ \sum \limits_{n=0}^\infty s^n \mathrm{e}^{\mathrm{i} n t} = \frac{1}{1 - s \mathrm{e}^{\mathrm{i} t}} \, . $$ Taking the real and the imaginary part of this equation and integrating the latter with respect to $t$ yields the Fourier series $$ \frac{1}{1+s^2 - 2 s \cos(t)} = \frac{1}{1-s^2} \left[1 + 2 \sum \limits_{m=1}^\infty s^m \cos(m t)\right] $$ and $$ -\log(1+s^2 - 2 s \cos(t)) = 2 \sum \limits_{n=1}^\infty \frac{s^n}{n} \cos(nt) \, , $$ respectively. They converge in $L^2$, so we can plug them into the integral to obtain \begin{align} \int \limits_0^\pi \frac{-\log(1+s^2 - 2 s \cos(t))}{1+s^2 - 2 s \cos(t)} \, \mathrm{d} s &= \frac{2}{1-s^2} \sum \limits_{n=1}^\infty \frac{s^n}{n} \left[\int \limits_0^\pi \cos(n t) \, \mathrm{d} t \right.\\ &\phantom{=\frac{2}{1-s^2} \sum \limits_{n=1}^\infty \frac{s^n}{n} \left[\vphantom{\int \limits_0^\pi}\right.} + \left. 2\sum \limits_{m=1}^\infty s^m \int \limits_0^\pi \cos(n t) \cos(m t) \, \mathrm{d} t \right] \\ &= \frac{2}{1-s^2} \sum \limits_{n=1}^\infty \frac{s^n}{n} \left[0 + 2\sum \limits_{m=1}^\infty s^m \frac{\pi}{2} \delta_{nm} \right] = \frac{2 \pi}{1-s^2} \sum \limits_{n=1}^\infty \frac{s^{2n}}{n} \\ &= 2 \pi \frac{-\log(1-s^2)}{1-s^2} \, . \end{align}