We will assume $K$ is real and positive.
Let $c = \cosh K$ and $s = \sinh K$. Notice $\cosh(2K) = c^2+s^2$ and $\sinh(2K) = 2sc$.
The integral at hand $\mathcal{I}$ equals to
$$\begin{align}\mathcal{I} &= \int_0^{2\pi} \log(c^2+s^2 - 2sc\cos\theta) d\theta = \int_0^{2\pi} \log((c -s e^{i\theta})(c - s e^{-i\theta})) d\theta\\\ &= 2\Re\left[\int_0^{2\pi} \log(c - se^{i\theta}) d\theta\right] \end{align} $$ Change variable to $z = e^{i\theta}$, the integral inside the bracket can be rewritten as a contour integral over the unit circle.
$$\mathcal{I} = 4\pi\Re\left[\frac{1}{2\pi i}\int_{|z|=1} \log(c - sz) \frac{dz}{z}\right]$$
Notice $c > s > 0$, the function $\log(c - sz)$ is entire over some open circle the contains the closed unit disk. By Cauchy integral formula, we get $$\mathcal{I} = 4\pi\Re\left[ \log(c- s\cdot 0))\right] = 4\pi\log(c) = 4\pi\log(\cosh K)$$