diff include/freeDiameter/libfreeDiameter.h @ 174:2b2f78036749

Added simple command-line switch to turn on full debug for specific function or file
author Sebastien Decugis <sdecugis@nict.go.jp>
date Wed, 03 Feb 2010 15:58:56 +0900
parents 6db078b955e3
children 0ea50d66ad1b
line wrap: on
line diff
--- a/include/freeDiameter/libfreeDiameter.h	Wed Feb 03 11:43:22 2010 +0900
+++ b/include/freeDiameter/libfreeDiameter.h	Wed Feb 03 15:58:56 2010 +0900
@@ -97,6 +97,8 @@
  */
 void fd_log_debug ( char * format, ... );
 extern pthread_mutex_t	fd_log_lock;
+extern char * fd_debug_one_function;
+extern char * fd_debug_one_file;
 
 /*
  * FUNCTION:	fd_log_threadname
@@ -165,7 +167,9 @@
 #endif /* __PRETTY_FUNCTION__ */
 
 /* Boolean for tracing at a certain level */
-#define TRACE_BOOL(_level_) ( (_level_) <= local_debug_level + fd_g_debug_lvl )
+#define TRACE_BOOL(_level_) ( ((_level_) <= local_debug_level + fd_g_debug_lvl) 					\
+				|| (fd_debug_one_function && !strcmp(fd_debug_one_function, __PRETTY_FUNCTION__)) 	\
+				|| (fd_debug_one_file && !strcmp(fd_debug_one_file, __FILE__) ) )
 
 /* The general debug macro, each call results in two lines of debug messages (change the macro for more compact output) */
 #define TRACE_DEBUG(level,format,args... ) {											\
"Welcome to our mercurial repository"