summaryrefslogtreecommitdiff
path: root/debug_filter.c
diff options
context:
space:
mode:
Diffstat (limited to 'debug_filter.c')
-rw-r--r--debug_filter.c12
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) {