# HG changeset patch # User Sebastien Decugis # Date 1273739127 -32400 # Node ID d46b454ccc33156acaa2bdd33850618ff9683d1c # Parent e7f283c06ffc76fba64bc77b12879fee94b061b6 Simplify traces format in case of non Debug configuration diff -r e7f283c06ffc -r d46b454ccc33 include/freeDiameter/libfreeDiameter.h --- a/include/freeDiameter/libfreeDiameter.h Thu May 13 17:13:47 2010 +0900 +++ b/include/freeDiameter/libfreeDiameter.h Thu May 13 17:25:27 2010 +0900 @@ -210,6 +210,8 @@ /************* The general debug macro, each call results in two lines of debug messages (change the macro for more compact output) *************/ +#ifdef DEBUG +/* In DEBUG mode, we add (a lot of) meta-information along each trace. This makes multi-threading problems easier to debug. */ #define TRACE_DEBUG(level,format,args... ) { \ if ( TRACE_BOOL(level) ) { \ char __buf[25]; \ @@ -220,6 +222,14 @@ (level < FULL)?"@":" ",level, "", ## args); \ } \ } +#else /* DEBUG */ +/* Do not print thread, function, ... only the message itself in this case. */ +#define TRACE_DEBUG(level,format,args... ) { \ + if ( TRACE_BOOL(level) ) { \ + fd_log_debug(format "\n", ## args); \ + } \ +} +#endif /* DEBUG */ /************* Derivatives from this macro