# HG changeset patch # User Sebastien Decugis # Date 1299044239 -32400 # Node ID da8bfb0709009507565fb46c10c3a4d8b73d082a # Parent f065e9dfdb98080a130b6a93c66be8419a1c2189 Fix the logic of local + global debug level diff -r f065e9dfdb98 -r da8bfb070900 include/freeDiameter/libfdproto.h --- a/include/freeDiameter/libfdproto.h Tue Mar 01 10:48:30 2011 +0900 +++ b/include/freeDiameter/libfdproto.h Wed Mar 02 14:37:19 2011 +0900 @@ -172,15 +172,15 @@ #define FCTS 6 /* Display entry parameters of most functions */ #define CALL 9 /* Display calls to most functions (with CHECK macros) */ -/* Default level is INFO */ +/* Increment the debug level for a file at compilation time by defining -DTRACE_LEVEL=FULL for example. */ #ifndef TRACE_LEVEL -#define TRACE_LEVEL INFO +#define TRACE_LEVEL NONE #endif /* TRACE_LEVEL */ /* The level of the file being compiled. */ static int local_debug_level = TRACE_LEVEL; -/* A global level, changed by configuration or cmd line for example. default is 0. */ +/* A global level, changed by configuration or cmd line for example. Default is INFO (in libfdproto/log.c). */ extern int fd_g_debug_lvl; /* Some portability code to get nice function name in __PRETTY_FUNCTION__ */ diff -r f065e9dfdb98 -r da8bfb070900 libfdproto/log.c --- a/libfdproto/log.c Tue Mar 01 10:48:30 2011 +0900 +++ b/libfdproto/log.c Wed Mar 02 14:37:19 2011 +0900 @@ -39,7 +39,7 @@ pthread_mutex_t fd_log_lock = PTHREAD_MUTEX_INITIALIZER; pthread_key_t fd_log_thname; -int fd_g_debug_lvl = 0; +int fd_g_debug_lvl = INFO; /* These may be used to pass specific debug requests via the command-line parameters */ char * fd_debug_one_function = NULL;