diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2016-08-12 17:59:45 +0100 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2016-09-30 19:36:50 +0100 |
commit | 92bd5ef29010acd9385054f4b0e899c08b6051b9 (patch) | |
tree | 255b2f4ee9e922b19fb02bb4065e487802aebd30 /dbus/dbus-sysdeps.c | |
parent | b5c229d3f8ecaf6e304d961b4a4efaf857bcd3a0 (diff) | |
download | dbus-92bd5ef29010acd9385054f4b0e899c08b6051b9.tar.gz |
_dbus_logv: configurably log to syslog and/or stderr
This changes the behaviour of _dbus_logv() if _dbus_init_system_log() was
not called. Previously, _dbus_logv() would always log to syslog;
additionally, it would log to stderr, unless the process is dbus-daemon
and it was started by systemd. Now, it will log to stderr only,
unless _dbus_init_system_log() was called first.
This is the desired behaviour because when we hook up
_dbus_warn_check_failed() to _dbus_logv() in the next commit, we don't
want typical users of libdbus to start logging their check failures to
syslog - we only want the dbus-daemon to do that.
In practice this is not usually a behaviour change, because there was
only one situation in which we called _dbus_logv() without first calling
_dbus_init_system_log(), namely an error while parsing configuration
files. Initialize the system log "just in time" in that situation
to preserve existing behaviour.
Signed-off-by: Simon McVittie <smcv@debian.org>
Diffstat (limited to 'dbus/dbus-sysdeps.c')
-rw-r--r-- | dbus/dbus-sysdeps.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dbus/dbus-sysdeps.c b/dbus/dbus-sysdeps.c index d004ff03..c58377bd 100644 --- a/dbus/dbus-sysdeps.c +++ b/dbus/dbus-sysdeps.c @@ -752,7 +752,7 @@ _dbus_strerror_from_errno (void) } /** - * Log a message to the system log file (e.g. syslog on Unix). + * Log a message to the system log file (e.g. syslog on Unix) and/or stderr. * * @param severity a severity value * @param msg a printf-style format string |