comparison include/freeDiameter/libfdproto.h @ 1237:b255ba44f59c

Add an option DEBUG_WITHOUT_META to strip some information from the log prefix
author Sebastien Decugis <sdecugis@freediameter.net>
date Sat, 02 Nov 2013 22:27:34 +0800
parents e72c9dad62ac
children b25ca6134bdc
comparison
equal deleted inserted replaced
1236:a0d9fb49694e 1237:b255ba44f59c
293 #define __STRIPPED_FILE__ (file_bname ?: file_bname_init((char *)__FILE__)) 293 #define __STRIPPED_FILE__ (file_bname ?: file_bname_init((char *)__FILE__))
294 294
295 295
296 296
297 /* In DEBUG mode, we add meta-information along each trace. This makes multi-threading problems easier to debug. */ 297 /* In DEBUG mode, we add meta-information along each trace. This makes multi-threading problems easier to debug. */
298 #ifdef DEBUG 298 #if (defined(DEBUG) && !defined(DEBUG_WITHOUT_META))
299 # define STD_TRACE_FMT_STRING "pid:%s in %s@%s:%d: " 299 # define STD_TRACE_FMT_STRING "pid:%s in %s@%s:%d: "
300 # define STD_TRACE_FMT_ARGS , ((char *)pthread_getspecific(fd_log_thname) ?: "unnamed"), __PRETTY_FUNCTION__, __STRIPPED_FILE__, __LINE__ 300 # define STD_TRACE_FMT_ARGS , ((char *)pthread_getspecific(fd_log_thname) ?: "unnamed"), __PRETTY_FUNCTION__, __STRIPPED_FILE__, __LINE__
301 #else /* DEBUG */ 301 #else /* DEBUG && !DEBUG_WITHOUT_META */
302 # define STD_TRACE_FMT_STRING "" 302 # define STD_TRACE_FMT_STRING ""
303 # define STD_TRACE_FMT_ARGS 303 # define STD_TRACE_FMT_ARGS
304 #endif /* DEBUG */ 304 #endif /* DEBUG && !DEBUG_WITHOUT_META */
305 305
306 /************************* 306 /*************************
307 The general debug macro 307 The general debug macro
308 *************************/ 308 *************************/
309 #define LOG(printlevel,format,args... ) \ 309 #define LOG(printlevel,format,args... ) \
"Welcome to our mercurial repository"