Minimal dynamic bindings for libsystemd.so
:
int sd_notify(int unset_environment, const char* state)
int sd_pid_notify(pid_t pid, int unset_environment, const char *state)
int sd_journal_print(int priority, const char* fmt, ...)
int sd_journal_send(const char* fmt, ...)
int sd_journal_sendv(const iovec* data, int cnt)
int sd_journal_perror(const char *message)
with minimal wraps:
int sdNotify(int unset_environment, string state)
int sdNotify_ready(int unset_environment=0) @nogc
sendstate="READY=1"
int sdNotify_reloading(int unset_environment=0) @nogc
sendstate="RELOADING=1"
int sdNotify_stopping(int unset_environment=0) @nogc
sendstate="STOPPING=1"
int sdNotify_watchdog(int unset_environment=0) @nogc
sendstate="WATCHDOG=1"
int sdPidNotify(pid_t pid, int unset_environment, string state)
int sdNotifyf(Args...)(int unset_environment, string fmt, Args args)
with Dformat
int sdPidNotifyf(Args...)(pid_t pid, int unset_environment, string fmt, Args args)
with Dformat
and 2 std.experimental.logger.Logger
implementations:
SDSimpleLogger
not uselibsystemd
, only specific format output tostderr
SDJournalLogger
usesd_journal_sendv
inwriteLogMsg
and callinitSystemDLib
in ctor. It also add custom fields asCODE_MODULE
(exact module name),CODE_MODULE0
(first level),CODE_MODULE1
(second level) can be used as tags for filtering (read more)
See example