From 00a52b397a7bd98b21ea09643abbba91cbb1e2ae Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Wed, 31 May 2017 10:42:33 -0400 Subject: [PATCH] Logging: require modules to define BT_LOG_OUTPUT_LEVEL MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- include/babeltrace/logging-internal.h | 6 +++++- logging/log.c | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/babeltrace/logging-internal.h b/include/babeltrace/logging-internal.h index e9ce365e..8805306e 100644 --- a/include/babeltrace/logging-internal.h +++ b/include/babeltrace/logging-internal.h @@ -156,7 +156,11 @@ #if defined(BT_LOG_OUTPUT_LEVEL) #define _BT_LOG_OUTPUT_LEVEL BT_LOG_OUTPUT_LEVEL #else - #define _BT_LOG_OUTPUT_LEVEL _bt_log_global_output_lvl + /* + * We disallow this to make sure Babeltrace modules always + * have their own local log level. + */ + #error No log level symbol specified: please define BT_LOG_OUTPUT_LEVEL before including this header. #endif /* "Tag" is a compound string that could be associated with a log message. It diff --git a/logging/log.c b/logging/log.c index 6d09e56b..4bd5014d 100644 --- a/logging/log.c +++ b/logging/log.c @@ -291,6 +291,9 @@ #include #include #include + +#define BT_LOG_OUTPUT_LEVEL dummy + #include #include -- 2.34.1