From: Philippe Proulx Date: Fri, 9 Aug 2019 21:24:59 +0000 (-0400) Subject: logging/log.h: always write the source file name and line number X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=791642585255b23736a167fc27e4c94db2878541 logging/log.h: always write the source file name and line number We don't need to protect our source file names and line numbers in the logs of a production build, so always write them. Signed-off-by: Philippe Proulx Change-Id: I837dd0cfc4cf3279aa26f813f3ebae2b7f4d4d55 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1861 Tested-by: jenkins --- diff --git a/src/logging/log.h b/src/logging/log.h index 20754c1f..993479c7 100644 --- a/src/logging/log.h +++ b/src/logging/log.h @@ -232,39 +232,8 @@ #define BT_LOG_SRCLOC_SHORT 1 #define BT_LOG_SRCLOC_LONG 2 -/* Source location format is configured per compilation module (.c/.cpp/.m - * file) by defining BT_LOG_DEF_SRCLOC or BT_LOG_SRCLOC. BT_LOG_SRCLOC has - * higer priority and when defined overrides value provided by - * BT_LOG_DEF_SRCLOC. - * - * Common practice is to define default format with BT_LOG_DEF_SRCLOC in - * build script (e.g. Makefile, CMakeLists.txt, gyp, etc.) for the entire - * project or target: - * - * CC_ARGS := -DBT_LOG_DEF_SRCLOC=BT_LOG_SRCLOC_LONG - * - * And when necessary to override it with BT_LOG_SRCLOC in .c/.cpp/.m files - * before including bt_log.h: - * - * #define BT_LOG_SRCLOC BT_LOG_SRCLOC_NONE - * #include "logging.h" - * - * If both BT_LOG_DEF_SRCLOC and BT_LOG_SRCLOC are undefined, then - * BT_LOG_SRCLOC_NONE will be used for release builds (BT_DEBUG_MODE is - * NOT defined) and BT_LOG_SRCLOC_LONG otherwise (BT_DEBUG_MODE is - * defined). - */ -#if defined(BT_LOG_SRCLOC) - #define _BT_LOG_SRCLOC BT_LOG_SRCLOC -#elif defined(BT_LOG_DEF_SRCLOC) - #define _BT_LOG_SRCLOC BT_LOG_DEF_SRCLOC -#else - #ifdef BT_DEBUG_MODE - #define _BT_LOG_SRCLOC BT_LOG_SRCLOC_LONG - #else - #define _BT_LOG_SRCLOC BT_LOG_SRCLOC_NONE - #endif -#endif +#define _BT_LOG_SRCLOC BT_LOG_SRCLOC_LONG + #if BT_LOG_SRCLOC_LONG == _BT_LOG_SRCLOC #define _BT_LOG_SRCLOC_FUNCTION _BT_LOG_FUNCTION #else