X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fprocd.git;a=blobdiff_plain;f=log.h;h=f0c4268f1be1760012b1a4bdd8aa4b931f99c6f9;hp=968c1366d7c163eb739397b2ec0b059220b08036;hb=c3faabeb635ce515b831afb2e87d9bb241991907;hpb=916f95cb58604038695347ee41a430d8ca1f0556 diff --git a/log.h b/log.h index 968c136..f0c4268 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_NOTICE, 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;