From bf73de8ded17a3841b2fc0e4d5d10b490182e2ff Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 13 Dec 2012 10:00:30 +0100 Subject: Fix compilation without any modules. Add warning to debug_syslog if symbol not set, but the files is being compiled. Change symbol-not-set error in debug_filter to warning. Add do-not-print-date option for stdout output. Fix missing reference to extern debug_class_str. --- debug_filter.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'debug_filter.c') diff --git a/debug_filter.c b/debug_filter.c index 4caf4be..23e83dd 100644 --- a/debug_filter.c +++ b/debug_filter.c @@ -31,7 +31,7 @@ #include #ifndef WITH_DBG_FILTER -#error debug_filter.c compiled but WITH_DBG_FILTER not defined +#warning debug_filter.c compiled but WITH_DBG_FILTER not defined #endif #define NELEM(x) (sizeof(x)/sizeof((x)[0])) @@ -45,7 +45,9 @@ struct __debug_channel static struct __debug_channel debug_channel[__DEBUG_CHANNEL_MAX]; static unsigned n_debug_channel = 0; -static unsigned debug_flags = (1 << __class_err) | (1 << __class_fixme); + +// Default is to enable everything... +static unsigned debug_flags = 0xffffffff;//(1<<__class_err)|(1<<__class_fixme); int dbg_filter_enabled(const enum __debug_class cl, const char *ch) { @@ -58,8 +60,6 @@ int dbg_filter_enabled(const enum __debug_class cl, const char *ch) return debug_flags & (1 << cl); } -extern const char * const *debug_class_str; - /* * fmt := [set[,set]*]* * set := [+-]channel @@ -72,6 +72,10 @@ int dbg_filter_parse(const char *filter) char *next; char *opt; + // NOTE: This must be identical to the debug_class_str in debug.c + const char * const debug_class_str[] = + { "fixme", "err", "warn", "info", "debug" }; + if(!(s = strdup(filter))) return 1; for(opt = s; opt; opt = next) { -- cgit v1.2.3