X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fprocd.git;a=blobdiff_plain;f=log.h;h=bf86f1efb908cd247ff6f4486553fc98112964d6;hp=968c1366d7c163eb739397b2ec0b059220b08036;hb=8d720b2c2e569885c6e1e7eab68d36f31818ed84;hpb=916f95cb58604038695347ee41a430d8ca1f0556 diff --git a/log.h b/log.h index 968c136..bf86f1e 100644 --- a/log.h +++ b/log.h @@ -15,23 +15,15 @@ #ifndef __LOG_H #define __LOG_H -#include +#include #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;