projects
/
project
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4bff1b5
)
add new debug macro
author
Felix Fietkau
<nbd@openwrt.org>
Sun, 24 Jun 2012 22:03:01 +0000
(
00:03
+0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Sun, 24 Jun 2012 22:03:01 +0000
(
00:03
+0200)
procd.h
patch
|
blob
|
history
diff --git
a/procd.h
b/procd.h
index 4009afc6e6753bb5a29025a2ef10f9b5076d44d7..6461be66b3180f396af244d699daffaf8aca2036 100644
(file)
--- 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);