X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fprocd.git;a=blobdiff_plain;f=procd.h;h=66a08e2d125f7f765f252e19fce0b988e7424030;hp=4009afc6e6753bb5a29025a2ef10f9b5076d44d7;hb=5baf6ea0abf218c6743a59cfc46a00318772f8fc;hpb=e0d721487a618490a7db06f76904868a71684071 diff --git a/procd.h b/procd.h index 4009afc..66a08e2 100644 --- a/procd.h +++ b/procd.h @@ -2,6 +2,7 @@ #define __PROCD_H #include +#include #include #include @@ -12,6 +13,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);