[rrd-developers] [PATCH] rrdcached: Log to stderr (in addition to syslog) when running in foreground.
Sebastian Harl
sh at tokkee.org
Mon Mar 22 14:52:04 CET 2010
---
program/src/rrd_daemon.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/program/src/rrd_daemon.c b/program/src/rrd_daemon.c
index d42fb0e..aa1d35b 100644
--- a/program/src/rrd_daemon.c
+++ b/program/src/rrd_daemon.c
@@ -111,7 +111,12 @@
#include <glib-2.0/glib.h>
/* }}} */
-#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) /**/
--
1.6.5.rc2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.oetiker.ch/pipermail/rrd-developers/attachments/20100322/0f9e5238/attachment.pgp
More information about the rrd-developers
mailing list