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.
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.
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.
---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/370#issuecomment-149519506