summaryrefslogtreecommitdiffstats
path: root/procd.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-06-25 00:03:01 +0200
committerFelix Fietkau <nbd@openwrt.org>2012-06-25 00:03:01 +0200
commit4a1bfc6ec5033236742967e548bfac9efe851c91 (patch)
tree3a288693cc7c6db6ce57a70f8c67a5c21e28ab38 /procd.h
parent4bff1b5ebcffc1488649199b88d3602184edf7f3 (diff)
downloadunitd-4a1bfc6ec5033236742967e548bfac9efe851c91.tar
unitd-4a1bfc6ec5033236742967e548bfac9efe851c91.zip
add new debug macro
Diffstat (limited to 'procd.h')
-rw-r--r--procd.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/procd.h b/procd.h
index 4009afc..6461be6 100644
--- a/procd.h
+++ b/procd.h
@@ -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);