METHOD 1:
For the branch points at $z=a$ and $z=b$, we choose branch cuts as straight line contours, that begin at the branch points, intersect the unit circle at $e^{i\phi_a}$ and $e^{i\phi_b}$, then extend to the point at infinity. Note that these branch cuts are not unique.
Now, let $z=e^{it}$. Then, we have
$$\begin{align}
\oint_{|z|=1} \log(z-a)\,dz &= \int_0^{\phi_a^-}\log(e^{it})ie^{it}\,dt+ \int_{\phi_a^+}^{2\pi}\log(e^{it})ie^{it}\,dt\\\\
&=\left.\left((e^{it}-a)\left(\log(e^{it}-a)-1\right)\right)\right|_{0}^{\phi_a^-}+\left.\left((e^{it}-a)\left(\log(e^{it}-a)-1\right)\right)\right|_{\phi_a^+}^{2\pi}\\\\
&=2\pi i (e^{i\phi_a}-a)
\end{align}$$
Similarly, we have
$$\oint_{|z|=1} \log(z-b)\,dz =2\pi i (e^{i\phi_b}-b)$$
Putting it together, we have
$$\oint_{|z|=1} \log\left(\frac{z-a}{z-b}\right)\,dz =2\pi i (e^{i\phi_a}-e^{i\phi_b}+(b-a))$$
If we choose $\phi_a=\phi_b$, then the integral of interest becomes
$$\oint_{|z|=1} \log\left(\frac{z-a}{z-b}\right)\,dz =2\pi i (b-a) \tag1$$
METHOD 2:
Here, we note that if the branch cut is chosen to adjoin the branch points, then the integrand is analytic outside $|z|=1$. Therefore, we can evaluate the integral of interest using the Residue Theorem with the Residue at Infinity. To that end, we have
$$\begin{align}
\oint_{|z|=1} \log\left(\frac{z-a}{z-b}\right)\,dz &=-2\pi i \text{Res}\left(-\frac{1}{z^2}\log\left(\frac{z^{-1}-a}{z^{-1}-b}\right),z=0\right)\\\\
&=2\pi i\lim_{z\to 0} \left(\frac{1}{z}\log\left(\frac{1-az}{1-bz}\right)\right)\\\\
&=2\pi i (b-a)
\end{align}$$
recovering the result in $(1)$!