diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-06-25 00:03:01 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-06-25 00:03:01 +0200 |
commit | 4a1bfc6ec5033236742967e548bfac9efe851c91 (patch) | |
tree | 3a288693cc7c6db6ce57a70f8c67a5c21e28ab38 | |
parent | 4bff1b5ebcffc1488649199b88d3602184edf7f3 (diff) | |
download | unitd-4a1bfc6ec5033236742967e548bfac9efe851c91.tar unitd-4a1bfc6ec5033236742967e548bfac9efe851c91.zip |
add new debug macro
-rw-r--r-- | procd.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -12,6 +12,11 @@ fprintf(stderr, "DEBUG %s(%d): " fmt, __func__, __LINE__, ## __VA_ARGS__); \ } while (0) +#define DEBUG(level, fmt, ...) do { \ + if (debug >= level) \ + fprintf(stderr, "DEBUG %s(%d): " fmt, __func__, __LINE__, ## __VA_ARGS__); \ + } while (0) + extern int debug; extern char *ubus_socket; void procd_connect_ubus(void); |