Solution (source code)

= Solution

Use the <principal complex logarithm>:
$$
\boxed{L(z)=\log|z|+i\operatorname{Arg}z,\qquad-\pi<\operatorname{Arg}z<\pi.}
$$
The excluded nonpositive real ray allows a <continuous> choice of argument, and $L(1)=0$. For $z=x+iy$, its <real part> is $u=\tfrac12\log(x^2+y^2)$. Differentiating the chosen local argument gives
$$
u_x=\frac{x}{x^2+y^2},\quad u_y=\frac{y}{x^2+y^2},\quad
v_x=-\frac{y}{x^2+y^2},\quad v_y=\frac{x}{x^2+y^2}.
$$
These <continuous> partial derivatives satisfy the <Cauchy-Riemann equations>, proving <holomorphy> on the slit domain. Its <derivative> is
$$
\boxed{L'(z)=u_x+iv_x=\frac{x-iy}{x^2+y^2}=\frac1z.}
$$