Dont store debug level DEBUG_DEBUG in the in-memory ringbuffer.
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 4 Dec 2009 00:45:37 +0000 (11:45 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 4 Dec 2009 00:45:37 +0000 (11:45 +1100)
It is unlikely we will need something this verbose for normal troubleshooting.
This allows us to keep a significantly longer time interval of log messages
in the 500k slots available in the ringbuffer.

include/includes.h
lib/util/debug.c

index 4b4d2428ef13529b04cb135ecde67cb70cb4db65..b7e2105dd6a80f46435cbb947e549f3078780240 100644 (file)
@@ -28,7 +28,7 @@ enum debug_level {
        DEBUG_DEBUG   =  4,
 };
 
-#define DEBUG(lvl, x) do { this_log_level = (lvl); log_ringbuffer x; if ((lvl) <= LogLevel) { do_debug x; }} while (0)
+#define DEBUG(lvl, x) do { this_log_level = (lvl); if ((lvl) < DEBUG_DEBUG) { log_ringbuffer x; } if ((lvl) <= LogLevel) { do_debug x; }} while (0)
 
 #define _PUBLIC_
 
index 659757034815d0ca1978de4e46364848d234bbae..d4d3bd643e54835c64e38b87a2bc717658184828 100644 (file)
@@ -90,7 +90,7 @@ void do_debug_add(const char *format, ...)
 }
 
 #define DEBUGLVL(lvl) ((lvl) <= LogLevel)
-#define DEBUG(lvl, x) do { this_log_level = (lvl); log_ringbuffer x; if ((lvl) <= LogLevel) { do_debug x; }} while (0)
+#define DEBUG(lvl, x) do { this_log_level = (lvl); if ((lvl) < DEBUG_DEBUG) { log_ringbuffer x; } if ((lvl) <= LogLevel) { do_debug x; }} while (0)
 #define DEBUGADD(lvl, x) do { if ((lvl) <= LogLevel) { this_log_level = (lvl); do_debug_add x; }} while (0)
 
 static void print_asc(int level, const uint8_t *buf, size_t len)