Browse Source

add new debug macro

Felix Fietkau 11 years ago
parent
commit
4a1bfc6ec5
1 changed files with 5 additions and 0 deletions
  1. 5 0
      procd.h

+ 5 - 0
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);