[PATCH] rrdcached: Log to stderr (in addition to syslog) when running in foreground.
Sebastian Harl <[email protected]>
| Newsgroups | gmane.comp.db.rrdtool.devel |
|---|---|
| Message-ID | <[email protected]> |
---
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
_______________________________________________
rrd-developers mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
signature.asc
(application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkundgQACgkQEFEKc4UBx/yM5ACfTfEZR64WkmZHxQ6zFUUgR/qc AtUAn2kKVODd/I0+Y7Z0vmxWzF4PNCBq =sx4w -----END PGP SIGNATURE-----