# HG changeset patch # User Sebastien Decugis # Date 1371530670 -28800 # Node ID b1c4876b1896443a750aa12e31c051c6375796d9 # Parent c38bb8b69c43e0ddc421af09a340c1c9acfd1d1d Change LOG_A definition so that when --dbg_func or --dbg_file are specified, the logs appear at DBG level diff -r c38bb8b69c43 -r b1c4876b1896 include/freeDiameter/libfdproto.h --- a/include/freeDiameter/libfdproto.h Mon Jun 17 18:19:53 2013 +0800 +++ b/include/freeDiameter/libfdproto.h Tue Jun 18 12:44:30 2013 +0800 @@ -314,7 +314,12 @@ */ #ifdef DEBUG # define LOG_A(format,args... ) \ - LOG(FD_LOG_ANNOYING,format,##args) + do { if ((fd_debug_one_function && !strcmp(fd_debug_one_function, __PRETTY_FUNCTION__)) \ + || (fd_debug_one_file && !strcmp(fd_debug_one_file, __STRIPPED_FILE__) ) ) { \ + LOG(FD_LOG_DEBUG,"[DBG_MATCH] " format,##args); \ + } else { \ + LOG(FD_LOG_ANNOYING,format,##args); \ + } } while (0) #else /* DEBUG */ # define LOG_A(format,args... ) /* not defined in release */ #endif /* DEBUG */ @@ -374,10 +379,7 @@ /* Helper for tracing the CHECK_* macros below -- very very verbose code execution! */ #define TRACE_CALL( str... ) \ - if ((fd_debug_one_function && !strcmp(fd_debug_one_function, __PRETTY_FUNCTION__)) \ - || (fd_debug_one_file && !strcmp(fd_debug_one_file, __STRIPPED_FILE__) ) ) { \ - LOG_A( str ); \ - } + LOG_A( str ) /* For development only, to keep track of TODO locations in the code */ #ifndef ERRORS_ON_TODO