diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-02-25 23:52:03 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-02-25 23:58:29 +0100 |
commit | 4bccbfa967d756b8c84a62ea4752e936d8545a73 (patch) | |
tree | dcb96ec1bae2005b3840493af73f12002f74d97f /log.h | |
parent | 7676df3226da5391c2dfda2ed29a40500e04e15b (diff) | |
download | unitd-4bccbfa967d756b8c84a62ea4752e936d8545a73.tar unitd-4bccbfa967d756b8c84a62ea4752e936d8545a73.zip |
Convert log calls to ulog() api
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'log.h')
-rw-r--r-- | log.h | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -15,23 +15,15 @@ #ifndef __LOG_H #define __LOG_H -#include <syslog.h> +#include <libubox/ulog.h> #define DEBUG(level, fmt, ...) do { \ if (debug >= level) { \ - syslog(0, fmt, ## __VA_ARGS__); \ - fprintf(stderr, "procd: %s(%d): " fmt, __func__, __LINE__, ## __VA_ARGS__); \ + ulog(LOG_DEBUG, fmt, ## __VA_ARGS__); \ } } while (0) -#define LOG(fmt, ...) do { \ - syslog(0, fmt, ## __VA_ARGS__); \ - fprintf(stderr, "procd: "fmt, ## __VA_ARGS__); \ - } while (0) - -#define ERROR(fmt, ...) do { \ - syslog(0, fmt, ## __VA_ARGS__); \ - fprintf(stderr, "procd: "fmt, ## __VA_ARGS__); \ - } while (0) +#define LOG ULOG_INFO +#define ERROR ULOG_ERR extern unsigned int debug; |