<p>My first thought was to use a pointer to logging function and set that by default to syslog. A module can overwrite the pointer with another function. Obviously that can happen when the module is loaded.</p>

<p>In this way, all logging will go through the new function, no need to change something else -- so xlog() as well as the other messages from C code will be handled by the new function.</p>

<p>On the other hand, sd_journal_print() seems to be a macro, meaning it cannot be used as pointer for a function. The advantage of the macro is ability to get the file name, line and function name of its use location. However, we already do this via our LOG/DEBUG macros, prefixing the log messages with these attributes.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/issues/370#issuecomment-149519506">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36Zayw2SMh52Wp0LD4l8lhF0V-LZS4ks5o9hMXgaJpZM4GPaeS.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/370#issuecomment-149519506"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>