With the integration I mean one counter-clockwise turn around the origin, i.e.
$\int_{\phi=0}^{2\pi}\ln(1-re^{i\phi})ire^{i\phi}d\phi$
For $r<1$, this is simply a contour integration on a holomorphic part of the logarithm and thus one should obtain 0, but for $r>1$ the integration path winds up to the next branch, so this is no longer a contour integral. According to Wolfram Alpha the indefinite integral is $2\pi$ periodic so the definite integral would vanish, but can I simply add the $2\pi i$ branch difference to obtain
$\begin{cases}0 & r<1 \\ 2\pi i & r>1\end{cases}$
or is the branch-respecting integration more involved? I was considering using $\ln(1-z)=\ln(|1-z|)+i\arg(1-z)$ demanding $\arg$ to remain continuous, but this seems to get rather a mess...
update I used MATLAB for numerical integration (which uses $\ln(1-z)=\ln(|1-z|)+i\text{atan2}(\Im(-z),1-\Re(z))$) and obtained this:
So, the solution should rather be
$\begin{cases}0 & r<1 \\ i(r-1) & r>1\end{cases}$
The question remains though, how to solve this analytically?