changeset 1213:b1c4876b1896

Change LOG_A definition so that when --dbg_func or --dbg_file are specified, the logs appear at DBG level
author Sebastien Decugis <sdecugis@freediameter.net>
date Tue, 18 Jun 2013 12:44:30 +0800
parents c38bb8b69c43
children c2fbaf2985f4
files include/freeDiameter/libfdproto.h
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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
"Welcome to our mercurial repository"