From: oetiker Date: Mon, 22 Mar 2010 14:51:06 +0000 (+0000) Subject: rrdcached: Log to stderr (in addition to syslog) when running in foreground. -- Sebas... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=333cbd9324ca1dc21ffa0e366e8117c264f97d5e;p=rrdtool-all.git rrdcached: Log to stderr (in addition to syslog) when running in foreground. -- Sebastian Harl git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@2037 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/rrd_daemon.c b/program/src/rrd_daemon.c index ba9c2adf..154f0dee 100644 --- a/program/src/rrd_daemon.c +++ b/program/src/rrd_daemon.c @@ -111,7 +111,12 @@ #include /* }}} */ -#define RRDD_LOG(severity, ...) syslog ((severity), __VA_ARGS__) +#define RRDD_LOG(severity, ...) \ + do { \ + if (stay_foreground) \ + fprintf(stderr, __VA_ARGS__); \ + syslog ((severity), __VA_ARGS__); \ + } while (0) #ifndef __GNUC__ # define __attribute__(x) /**/