As a part of a much bigger problem, I came across this integral
$$\int_{-\infty}^{\infty}\ln(|x|)\frac{1}{\sigma \sqrt{2\pi}}e^{-\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2}dx$$
which represents the expected value of a normal random variable after we take its log. Playing around with it and not getting anywhere, I plugged it into Mathemtica and it gave me
$$\ln\left(\frac{\sigma}{\sqrt{2}}\right)-\frac{\gamma}{2}-\left[\frac{\partial}{\partial a}1F1(a,b,z)\right]_{a=0,b=\frac{1}{2},z=-\frac{\mu^2}{2\sigma^2}}$$
where $1F1$ is the Kummer Confluent Hypergeometric Function and we take its partial derivative with respect to the first parameter and then plug in $a=0,b=\frac{1}{2},z=-\frac{\mu^2}{2\sigma^2}$. I was able to "simplify" the last term to get
$$\ln\left(\frac{\sigma}{\sqrt{2}}\right)-\frac{\gamma}{2}+\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{2^{n+1}}\cdot\frac{\sqrt{\pi}}{n \Gamma(n+1/2)}\cdot\left(\frac{\mu}{\sigma}\right)^{2n}$$
and I have verified all three expressions are equal numerically by computing the integral numerically (at least for $\mu/\sigma$ ratio being small). I also see that (using the $n$-th term test) that the sum converges for all real numbers. What I still don't understand is how to get from the first expression to the second one. I thought about maybe using Taylor series expansion for the Gaussian, multiply by log, but then I can't integrate them term by term on all of $\mathbb{R}$. Any help/hints/references will be appreciated. Thanks.
Addendum: If we make $\mu=0$, the sum is zero. So can we even say anything about how to get
$$\int_{-\infty}^{\infty}\ln(|x|)\frac{1}{\sigma \sqrt{2\pi}}e^{-\frac{1}{2}\left(\frac{x}{\sigma}\right)^2}dx=\ln\left(\frac{\sigma}{\sqrt{2}}\right)-\frac{\gamma}{2}?$$