Let $$y=\cos \phi+i\sin \phi \tag{1}$$
Differentiating both sides of equation (1) with respect to $\phi$, we get,
$$\begin{align} \frac{dy}{d\phi} &=-\sin \phi+i\cos \phi \\ &=i(\cos \phi-\frac{1}{i}\sin \phi) \\ &=i(\cos\phi+i\sin \phi) \\ &=iy \\ \implies\frac{1}{y}dy &=i\;d\phi \tag{2} \end{align}$$
Integrating both sides of equation (2), we get,
$$\begin{align} \int\frac{1}{y}dy&=\int i\;d\phi \\ \implies \ln(y)&=i\phi+c \tag{3} \end{align}$$
Substituting $\phi=0$ in equation (1), we get,
$$y=\cos 0+i\sin 0 \implies y=1 \tag{4}$$
Substituting $\phi=0$ and $y=1$ in equation (3) we get,
$$\ln(1)=c \implies c=0 \tag{5}$$
Substituting $c=0$ in equation (3) we get,
$$\begin{align} \ln(y)&=i\phi \tag{6}\\ \implies e^{i\phi}&=y \tag{7}\\ \therefore e^{i\phi}&=\cos \phi+i\sin \phi \tag{8} \end{align}$$
I found this proof in a book. I think that there is a problem. In $(3)$ and $(6)$, shouldn't $\ln(y)$ be $\ln|y|$ instead? Or is it that, for complex numbers, we do not take the absolute value of the number within the $\ln$?