Define the function $\mathcal{I}:\mathbb{R}^{2}\rightarrow\mathbb{R}$ via the definite integral
$$\mathcal{I}{\left(a,\theta\right)}:=\int_{0}^{\theta}\mathrm{d}\varphi\,\ln{\left(1-2a\cos{\left(\varphi\right)}+a^{2}\right)}.\tag{1}$$
The integral $\mathcal{I}$ can in general be evaluated in terms of elementary functions and the dilogarithm function of a complex argument, which is typically defined on the cut complex plane by the integral representation
$$\operatorname{Li}_{2}{\left(z\right)}:=-\int_{0}^{z}\mathrm{d}x\,\frac{\ln{\left(1-x\right)}}{x};~~~\small{z\in\mathbb{C}\setminus\left(1,\infty\right)},\tag{2a}$$
where the natural logarithm of a complex variable is defined by its own integral representation
$$\ln{\left(z\right)}:=\int_{1}^{z}\mathrm{d}x\,\frac{1}{x};~~~\small{z\in\mathbb{C}\setminus\left(-\infty,0\right]}.\tag{2b}$$
Recall that the Clausen function (of order $2$) is defined for real arguments via the integral representation
$$\operatorname{Cl}_{2}{\left(\theta\right)}:=-\int_{0}^{\theta}\mathrm{d}\varphi\,\ln{\left(\left|2\sin{\left(\frac{\varphi}{2}\right)}\right|\right)};~~~\small{\theta\in\mathbb{R}}.\tag{3a}$$
Another auxiliary function related to the dilogarithm is what I'll refer to here as the "two-variable dilogarithm", defined by the integral representation
$$\operatorname{Li}_{2}{\left(r,\theta\right)}:=-\frac12\int_{0}^{r}\mathrm{d}x\,\frac{\ln{\left(1-2x\cos{\left(\theta\right)}+x^{2}\right)}}{x};~~~\small{\left(r,\theta\right)\in\mathbb{R}^{2}}.\tag{3b}$$
Note: For $\left|r\right|<1$, $\Re{\left[\operatorname{Li}_{2}{\left(r\exp{i\theta}\right)}\right]}=\operatorname{Li}_{2}{\left(r,\theta\right)}$.
It turns out that any dilogarithm of a complex variable can be expressed in terms of the Clausen function and the two-variable dilogarithm. As such, we should be able to find a manifestly real expression for the integral $\mathcal{I}$ in terms of these functions.
Problem: Given $\left(a,\theta\right)\in\mathbb{R}^{2}$, find a closed-form expression for $\mathcal{I}{\left(a,\theta\right)}$ in terms of elementary functions, Clausen functions, and the two-variable dilogarithm.
Without any assumptions, a CAS gives $$\mathcal{I}{\left(a,\theta\right)}:=i\frac{ \pi \sqrt{-\frac{(a-1)^2}{a^2}} a \log (a)}{a-1}+\theta \log \left(-a e^{-i \theta }\right)+i\frac{ \theta ^2}{2}+$$ $$\frac{1}{6} i \left( \text{Li}_2\left(\frac{e^{i \theta }}{a}\right)+ \text{Li}_2\left(a e^{i \theta }\right)+\frac 12 \log ^2(a)-\frac { \pi ^2}3\right)$$ which can further be simplified depending on the range for $a$.