to make sense of this, you'll want to use the identity in integral form:

$\int_{-\infty}^{\infty}dx f(x) \frac{d}{dx}\log x=-i\pi f(0)+{\cal P}\int_{-\infty}^{\infty}dx f(x)\frac{1}{x}$.

The symbol ${\cal P}$ indicates that the Cauchy principal value of the integral is to be taken. Formalization then amounts to stating the conditions on $f$ so that the principal value integral exists.