logging/log.h: always write the source file name and line number
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 9 Aug 2019 21:24:59 +0000 (17:24 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 10 Aug 2019 05:54:03 +0000 (01:54 -0400)
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 <eeppeliteloop@gmail.com>
Change-Id: I837dd0cfc4cf3279aa26f813f3ebae2b7f4d4d55
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1861
Tested-by: jenkins <jenkins@lttng.org>
src/logging/log.h

index 20754c1f1d422b5c3ac67043f9ede4a7e3c23a75..993479c7fcfab48d9acb8138df5388c274d4f2f6 100644 (file)
 #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
This page took 0.027602 seconds and 4 git commands to generate.