diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-03-16 14:52:39 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-05-25 18:16:37 +0100 |
commit | 6e255ae93da9b7a4ec2717959cf6b9f20eaa6d1e (patch) | |
tree | a5608a4a9c62b1559addeea095e896e2728ab165 | |
parent | c9af1526d195f69e1ad794ea181f6b6341285a63 (diff) | |
download | dbus-6e255ae93da9b7a4ec2717959cf6b9f20eaa6d1e.tar.gz |
bus_context_log: divert messages to stderr if we're not using syslog
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35358
Reviewed-by: Colin Walters <walters@verbum.org>
-rw-r--r-- | bus/bus.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -23,6 +23,9 @@ #include <config.h> #include "bus.h" + +#include <stdio.h> + #include "activation.h" #include "connection.h" #include "services.h" @@ -36,6 +39,7 @@ #include <dbus/dbus-hash.h> #include <dbus/dbus-credentials.h> #include <dbus/dbus-internals.h> + #ifdef DBUS_CYGWIN #include <signal.h> #endif @@ -1283,7 +1287,14 @@ bus_context_log (BusContext *context, DBusSystemLogSeverity severity, const char va_list args; if (!context->syslog) - return; + { + /* we're not syslogging; just output to stderr */ + va_start (args, msg); + vfprintf (stderr, msg, args); + fprintf (stderr, "\n"); + va_end (args); + return; + } va_start (args, msg); @@ -1336,7 +1347,7 @@ complain_about_message (BusContext *context, const char *sender_loginfo; const char *proposed_recipient_loginfo; - if (error == NULL && !(context->syslog && log)) + if (error == NULL && !log) return; if (sender != NULL) |