# HG changeset patch # User Sebastien Decugis # Date 1434643210 -28800 # Node ID a22d9e907d48921c94ec1860212ac075827b583a # Parent 22cc3a9dd21684270e29732ee6fe2b8d18d6cacf Make the stripped output the default. Define DEBUG_WITH_META to get longer format. diff -r 22cc3a9dd216 -r a22d9e907d48 include/freeDiameter/CMakeLists.txt --- a/include/freeDiameter/CMakeLists.txt Thu Jun 18 23:01:08 2015 +0800 +++ b/include/freeDiameter/CMakeLists.txt Fri Jun 19 00:00:10 2015 +0800 @@ -15,8 +15,8 @@ # 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) +# In DEBUG mode, each log can contain pid, calling function and file for easy debug. Set to ON to display this information. +OPTION(DEBUG_WITH_META "Show calling location in logs?" OFF) # Create the absolute path for searching extensions SET(DEFAULT_EXTENSIONS_PATH ${CMAKE_INSTALL_PREFIX}/${INSTALL_EXTENSIONS_SUFFIX}) @@ -36,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 DEBUG_WITHOUT_META 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_WITH_META DIAMID_IDNA_IGNORE DIAMID_IDNA_REJECT DISABLE_PEER_EXPIRY WORKAROUND_ACCEPT_INVALID_VSAI) ######################## ### System checks part diff -r 22cc3a9dd216 -r a22d9e907d48 include/freeDiameter/freeDiameter-host.h.in --- a/include/freeDiameter/freeDiameter-host.h.in Thu Jun 18 23:01:08 2015 +0800 +++ b/include/freeDiameter/freeDiameter-host.h.in Fri Jun 19 00:00:10 2015 +0800 @@ -53,7 +53,7 @@ #cmakedefine DISABLE_SCTP #cmakedefine DEBUG_SCTP -#cmakedefine DEBUG_WITHOUT_META +#cmakedefine DEBUG_WITH_META #cmakedefine SCTP_USE_MAPPED_ADDRESSES #cmakedefine SCTP_CONNECTX_4_ARGS #cmakedefine SKIP_DLCLOSE diff -r 22cc3a9dd216 -r a22d9e907d48 include/freeDiameter/libfdproto.h --- a/include/freeDiameter/libfdproto.h Thu Jun 18 23:01:08 2015 +0800 +++ b/include/freeDiameter/libfdproto.h Fri Jun 19 00:00:10 2015 +0800 @@ -297,13 +297,13 @@ /* In DEBUG mode, we add meta-information along each trace. This makes multi-threading problems easier to debug. */ -#if (defined(DEBUG) && !defined(DEBUG_WITHOUT_META)) +#if (defined(DEBUG) && defined(DEBUG_WITH_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 && !DEBUG_WITHOUT_META */ +#else /* DEBUG && DEBUG_WITH_META */ # define STD_TRACE_FMT_STRING "" # define STD_TRACE_FMT_ARGS -#endif /* DEBUG && !DEBUG_WITHOUT_META */ +#endif /* DEBUG && DEBUG_WITH_META */ /************************* The general debug macro diff -r 22cc3a9dd216 -r a22d9e907d48 libfdproto/log.c --- a/libfdproto/log.c Thu Jun 18 23:01:08 2015 +0800 +++ b/libfdproto/log.c Fri Jun 19 00:00:10 2015 +0800 @@ -95,11 +95,11 @@ /* add timestamp */ printf("%s ", fd_log_time(NULL, buf, sizeof(buf), -#if (defined(DEBUG) && !defined(DEBUG_WITHOUT_META)) +#if (defined(DEBUG) && defined(DEBUG_WITH_META)) 1, 1 -#else /* (defined(DEBUG) && !defined(DEBUG_WITHOUT_META)) */ +#else /* (defined(DEBUG) && defined(DEBUG_WITH_META)) */ 0, 0 -#endif /* (defined(DEBUG) && !defined(DEBUG_WITHOUT_META)) */ +#endif /* (defined(DEBUG) && defined(DEBUG_WITH_META)) */ )); /* Use colors on stdout ? */ if (!use_colors) {