From dc95624041e36eeb40147b3a4da5765b05fb2ea8 Mon Sep 17 00:00:00 2001 From: Suchang Woo Date: Sat, 17 Oct 2015 20:47:57 +0900 Subject: [PATCH] common: use syslog Change-Id: I09fed3b93903d614da4cb77e31b8870a4048265a Signed-off-by: Suchang Woo --- common/backends.c | 1 + common/log.h | 18 +++++------------- daemon/cynara.c | 1 + daemon/daemon.c | 1 + 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/common/backends.c b/common/backends.c index e5ee17c..f067882 100644 --- a/common/backends.c +++ b/common/backends.c @@ -16,6 +16,7 @@ * limitations under the License. */ +#include #include #include #include diff --git a/common/log.h b/common/log.h index 62d5fae..4c028e1 100644 --- a/common/log.h +++ b/common/log.h @@ -26,24 +26,16 @@ #else /* _DLOG_H_ */ -# include +# include -# if !defined(DEBUG_LOG) +# define bxt_info(fmt, ...) syslog(LOG_INFO, "Buxton: " fmt, ##__VA_ARGS__) +# define bxt_err(fmt, ...) syslog(LOG_ERR, "Buxton: " fmt, ##__VA_ARGS__) -# define bxt_info(fmt, ...) printf("Buxton: " fmt "\n", ##__VA_ARGS__) -# define bxt_err(fmt, ...) \ - fprintf(stderr, "Buxton: " fmt "\n", ##__VA_ARGS__) +# if !defined(DEBUG_LOG) # define bxt_dbg(fmt, ...) do { } while (0) - # else /* DEBUG_LOG */ - -# define bxt_info(fmt, ...) printf("Buxton: " fmt "\n", ##__VA_ARGS__) -# define bxt_err(fmt, ...) \ - fprintf(stderr, "Buxton:Err: " fmt "\n", ##__VA_ARGS__) # define bxt_dbg(fmt, ...) \ - printf("Buxton:D:%s:%d: " fmt "\n", __func__, __LINE__, \ - ##__VA_ARGS__) - + syslog(LOG_DEBUG, "Buxton:%s:%d: " fmt, __func__, __LINE__, ##__VA_ARGS__) # endif /* DEBUG_LOG */ #endif /* _DLOG_H_ */ diff --git a/daemon/cynara.c b/daemon/cynara.c index 79129c7..64efd6a 100644 --- a/daemon/cynara.c +++ b/daemon/cynara.c @@ -16,6 +16,7 @@ * limitations under the License. */ +#include #include #include #include diff --git a/daemon/daemon.c b/daemon/daemon.c index b8df6a1..4f25a88 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -17,6 +17,7 @@ */ #define _GNU_SOURCE +#include #include #include #include -- 2.7.4