From: Felix Fietkau Date: Sun, 24 Jun 2012 22:03:01 +0000 (+0200) Subject: add new debug macro X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fprocd.git;a=commitdiff_plain;h=4a1bfc6ec5033236742967e548bfac9efe851c91;ds=sidebyside add new debug macro --- 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);