# HG changeset patch # User Sebastien Decugis # Date 1383402454 -28800 # Node ID b255ba44f59c9cfe8226f1eb897e84d178e1adf7 # Parent a0d9fb49694ea7ffaee3746a7636da998906f653 Add an option DEBUG_WITHOUT_META to strip some information from the log prefix diff -r a0d9fb49694e -r b255ba44f59c include/freeDiameter/CMakeLists.txt --- a/include/freeDiameter/CMakeLists.txt Sat Sep 14 12:56:05 2013 +0200 +++ b/include/freeDiameter/CMakeLists.txt Sat Nov 02 22:27:34 2013 +0800 @@ -15,6 +15,9 @@ # Find TODO items in the code easily ? OPTION(ERRORS_ON_TODO "(development) Generate compilation errors on TODO items ?" OFF) +# In DEBUG mode, each log contains pid, calling function and file for easy debug. Set to ON to strip this information. +OPTION(DEBUG_WITHOUT_META "Strip calling location in logs?" OFF) + # Create the absolute path for searching extensions SET(DEFAULT_EXTENSIONS_PATH ${CMAKE_INSTALL_PREFIX}/${INSTALL_EXTENSIONS_SUFFIX}) @@ -33,7 +36,7 @@ # compliancy of their implementation with the Diameter RFC... OPTION(WORKAROUND_ACCEPT_INVALID_VSAI "Do not reject a CER/CEA with a Vendor-Specific-Application-Id AVP containing both Auth- and Acct- application AVPs?" OFF) -MARK_AS_ADVANCED(DISABLE_SCTP DEBUG_SCTP SCTP_USE_MAPPED_ADDRESSES ERRORS_ON_TODO DIAMID_IDNA_IGNORE DIAMID_IDNA_REJECT DISABLE_PEER_EXPIRY WORKAROUND_ACCEPT_INVALID_VSAI) +MARK_AS_ADVANCED(DISABLE_SCTP DEBUG_SCTP SCTP_USE_MAPPED_ADDRESSES ERRORS_ON_TODO DEBUG_WITHOUT_META DIAMID_IDNA_IGNORE DIAMID_IDNA_REJECT DISABLE_PEER_EXPIRY WORKAROUND_ACCEPT_INVALID_VSAI) ######################## ### System checks part diff -r a0d9fb49694e -r b255ba44f59c include/freeDiameter/freeDiameter-host.h.in --- a/include/freeDiameter/freeDiameter-host.h.in Sat Sep 14 12:56:05 2013 +0200 +++ b/include/freeDiameter/freeDiameter-host.h.in Sat Nov 02 22:27:34 2013 +0800 @@ -53,6 +53,7 @@ #cmakedefine DISABLE_SCTP #cmakedefine DEBUG_SCTP +#cmakedefine DEBUG_WITHOUT_META #cmakedefine SCTP_USE_MAPPED_ADDRESSES #cmakedefine SCTP_CONNECTX_4_ARGS #cmakedefine SKIP_DLCLOSE diff -r a0d9fb49694e -r b255ba44f59c include/freeDiameter/libfdproto.h --- a/include/freeDiameter/libfdproto.h Sat Sep 14 12:56:05 2013 +0200 +++ b/include/freeDiameter/libfdproto.h Sat Nov 02 22:27:34 2013 +0800 @@ -295,13 +295,13 @@ /* In DEBUG mode, we add meta-information along each trace. This makes multi-threading problems easier to debug. */ -#ifdef DEBUG +#if (defined(DEBUG) && !defined(DEBUG_WITHOUT_META)) # define STD_TRACE_FMT_STRING "pid:%s in %s@%s:%d: " # define STD_TRACE_FMT_ARGS , ((char *)pthread_getspecific(fd_log_thname) ?: "unnamed"), __PRETTY_FUNCTION__, __STRIPPED_FILE__, __LINE__ -#else /* DEBUG */ +#else /* DEBUG && !DEBUG_WITHOUT_META */ # define STD_TRACE_FMT_STRING "" # define STD_TRACE_FMT_ARGS -#endif /* DEBUG */ +#endif /* DEBUG && !DEBUG_WITHOUT_META */ /************************* The general debug macro