Evaluate $\int_0^1 \log \left( \frac{x^2+\sqrt{3}x+1}{x^2-\sqrt{3}x+1} \right) \frac{dx}{x} $

Let $$I(\theta)=\int_0^1\frac{\ln(x^2+2x\cos\theta+1)}xdx,$$ differentiating it gives $$I'(\theta)=\int_0^1-\frac{2\sin\theta}{1+2x\cos\theta+x^2}dx\\ =-\theta$$ (since $\theta\in(-\pi,\pi)$)
The integral need to find is $$I\left(\frac16\pi\right)-I\left(\frac56\pi\right)=\int_{5/6\pi}^{1/6\pi}-\theta d\theta=\frac13\pi^2$$


Let us consider that for any $\alpha\in S^1$

$$ \int_{0}^{1}\frac{\log(1-\alpha x)}{x}\,dx = -\sum_{n\geq 1}\int_{0}^{1}\frac{\alpha^n x^{n}}{nx}\,dx=-\sum_{n\geq 1}\frac{\alpha^n}{n^2}=-\text{Li}_2(\alpha) $$ and by setting $\zeta=\exp\left(\frac{2\pi i}{12}\right)$ we have

$$ \int_{0}^{1}\log\left(\frac{1-\sqrt{3}x+x^2}{1+\sqrt{3}x+x^2}\right)\,\frac{dx}{x}=\int_{0}^{1}\left[\log(1-\zeta x)+\log(1-\zeta^{11} x)-\log(1-\zeta^5 x)-\log(1-\zeta^7 x)\right]\frac{dx}{x} $$ hence your integral equals $$ \text{Li}_2(\zeta)+\text{Li}_2(\zeta^{11})-\text{Li}_2(\zeta^5)-\text{Li}_2(\zeta^7)=2\text{Re}\,\text{Li}_2(\zeta)-2\text{Re}\,\text{Li}_2(\zeta^5). $$ Last trick: $\text{Re}\,\text{Li}_2(e^{i\theta})$ is an elementary function, since it is the formal primitive of the sawtooth wave $\sum_{n\geq 1}\frac{\sin(nx)}{n}$ (piecewise-linear), hence a periodic and piecewise-parabolic function. Putting everything together, the outcome is simply $2\zeta(2)=\frac{\pi^2}{3}$.