X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fugps.git;a=blobdiff_plain;f=log.h;h=bf86f1efb908cd247ff6f4486553fc98112964d6;hp=b8ae62180475466d02fc60a9298abe040a2326b7;hb=24df9761cc0f819847bfdb850ca6c07a2fc62893;hpb=1c31c99edd9de9dcb403750b04041eccc751ac5e diff --git a/log.h b/log.h index b8ae621..bf86f1e 100644 --- a/log.h +++ b/log.h @@ -15,18 +15,15 @@ #ifndef __LOG_H #define __LOG_H -#include -#include +#include -#define LOG(fmt, ...) do { \ - syslog(LOG_INFO, fmt, ## __VA_ARGS__); \ - fprintf(stderr, "ugps: "fmt, ## __VA_ARGS__); \ - } while (0) +#define DEBUG(level, fmt, ...) do { \ + if (debug >= level) { \ + ulog(LOG_DEBUG, fmt, ## __VA_ARGS__); \ + } } while (0) -#define ERROR(fmt, ...) do { \ - syslog(LOG_ERR, fmt, ## __VA_ARGS__); \ - fprintf(stderr, "ugps: "fmt, ## __VA_ARGS__); \ - } while (0) +#define LOG ULOG_INFO +#define ERROR ULOG_ERR extern unsigned int debug;