$\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{\displaystyle{#1}}\,}
\newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
\newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
\newcommand{\dd}{\mathrm{d}}
\newcommand{\ds}[1]{\displaystyle{#1}}
\newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
\newcommand{\ic}{\mathrm{i}}
\newcommand{\mc}[1]{\mathcal{#1}}
\newcommand{\mrm}[1]{\mathrm{#1}}
\newcommand{\pars}[1]{\left(\,{#1}\,\right)}
\newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
\newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
\newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
\newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
Since we are free to choose $\ds{\gamma}$, a 'nice candidate' is
$\ds{\gamma \equiv \braces{{1 \over 2}\,\ic + {3 \over 2}\expo{\ic\theta}\ \left.\vphantom{\large A}\right\vert\
\theta \in \pars{-\,{\pi \over 2},{\pi \over 2}}}}$.
\begin{align}
\int_{\gamma}{\dd z \over z} & = \int_{-\pi/2}^{\pi/2}
{\pars{3/2}\expo{\ic\theta}\ic\,\dd\theta \over
\ic/2 + \pars{3/2}\expo{\ic\theta}} =
\left.\ln\pars{{1 \over 2}\,\ic + {3 \over 2}\expo{\ic\theta}}
\right\vert_{\ -\pi/2}^{\pi/2}
\\[5mm] & =
\ln\pars{2i} - \ln\pars{-\ic} =
\bracks{\ln\pars{2} + {\pi \over 2}\,\ic} -
\bracks{\ln\pars{1} + \pars{-\,{\pi \over 2}\,\ic}} =
\bbx{\ln\pars{2} + \pi\ic}
\end{align}
Another posibility is to go 'straight' from $\ds{-\ic}$ to $\ds{2\ic}$ where we consider the $\ds{\ln}$-Principal Branch. In such a case the integration is reduced to:
\begin{align}
&\lim_{\epsilon \to 0^{+}}\pars{%
\int_{-1}^{-\epsilon}{\ic\,\dd y \over \ic y} +
\int_{-\pi/2}^{\pi/2}{\epsilon\expo{\ic\theta}\ic\,\dd\theta \over \epsilon\expo{\ic\theta}} +
\int_{\epsilon}^{2}{\ic\,\dd y \over \ic y}}
\\[5mm] = &\
\lim_{\epsilon \to 0^{+}}\bracks{%
\ln\pars{\epsilon} + \pi\ic + \ln\pars{2 \over \epsilon}} =
\bbx{\ln\pars{2} + \pi\ic}
\end{align}