diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2012-12-13 10:00:30 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2012-12-13 10:00:30 +0100 |
commit | bf73de8ded17a3841b2fc0e4d5d10b490182e2ff (patch) | |
tree | 55a68a416e7a42ed0018c59b8fc77308ff308bcf /debug_filter.c | |
parent | 19d68b15981f50f96b0220516334cd9622fe8b17 (diff) |
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.
Diffstat (limited to 'debug_filter.c')
-rw-r--r-- | debug_filter.c | 12 |
1 files changed, 8 insertions, 4 deletions
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 <stdlib.h> #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) { |