From 6e255ae93da9b7a4ec2717959cf6b9f20eaa6d1e Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 16 Mar 2011 14:52:39 +0000 Subject: [PATCH] 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 --- bus/bus.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bus/bus.c b/bus/bus.c index 2c911c5..6b0dc08 100644 --- a/bus/bus.c +++ b/bus/bus.c @@ -23,6 +23,9 @@ #include #include "bus.h" + +#include + #include "activation.h" #include "connection.h" #include "services.h" @@ -36,6 +39,7 @@ #include #include #include + #ifdef DBUS_CYGWIN #include #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) -- 2.7.4