Proving $\int_0^\infty \log\left (1-2\frac{\cos 2\theta}{x^2}+\frac{1}{x^4} \right)dx =2\pi \sin \theta$ 
Prove $$\int_0^\infty \log \left(1-2\frac{\cos 2\theta}{x^2}+\frac{1}{x^4} \right)dx =2\pi \sin \theta$$where $\theta\in[0,\pi]$.

I've met another similar problem,
$$ \int_0^{2\pi} \log(1-2r\cos \theta +r^2) d\theta=2\pi \log^+(r^2) $$
I am curious whether there is any relationship between them.
And I got stuck on the proposition in the title. I found that
$$1-2\frac{\cos 2\theta}{x^2}+\frac{1}{x^4} =\left(\frac{1}{x}-e^{i\theta}\right)\left(\frac{1}{x}+e^{i\theta}\right)\left(\frac{1}{x}-e^{-i\theta}\right)\left(\frac{1}{x}+e^{-i\theta}\right)$$
But I couldn't move on.
Any hints? Thanks in advance.

To complement Zacky's answer I'll add a proof that $I(0)=0$. Applying $x\mapsto\frac{1}{x}$ for $x\ge 1$ gives $$I(x)=2\int_0^\infty\ln|1-x^{-2}|dx=2\int_0^1\left[(1+\frac{1}{x^2})\ln(1-x^2)-2\ln x\right]\\=-2\int_0^1\left[(1+x^2)\sum_{n\ge 0}\frac{x^{2n}}{n+1}+2\ln x\right]dx=-2\int_0^1\left[\sum_{n\ge 0}\left(\frac{x^{2n}}{n+1}+\frac{x^{2n+2}}{n+1}\right)+2\ln x\right]dx\\=-2\left[\sum_{n\ge 0}\left(\frac{x^{2n+1}}{(n+1)(2n+1)}+\frac{x^{2n+3}}{(n+1)(2n+3)}\right)+2x\ln x-2x\right]_0^1\\=-2\left[\sum_{n\ge 0}\left(\frac{4}{(2n+1)(2n+3)}\right)-2\right],$$which vanishes by partial fractions.
