From: Philippe Proulx Date: Fri, 28 Jun 2019 21:03:27 +0000 (-0400) Subject: lib: internal: message.h: require logging X-Git-Tag: v2.0.0-rc1~601 X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=8a14e80e4ac32e21af0e986814287101bba8eb73;p=babeltrace.git lib: internal: message.h: require logging This patch makes the internal `message.h` require what it needs instead of using the macros only if they exist. This makes it impossible to skip logging in this header. Signed-off-by: Philippe Proulx Change-Id: I2dd300931479a1d0752b6f90079c826324e19ce1 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1581 Tested-by: jenkins Reviewed-by: Simon Marchi --- diff --git a/src/lib/graph/message/message.h b/src/lib/graph/message/message.h index 98d27b93..88924995 100644 --- a/src/lib/graph/message/message.h +++ b/src/lib/graph/message/message.h @@ -33,6 +33,11 @@ #include "lib/object-pool.h" #include +/* Protection: this file uses BT_LIB_LOG*() macros directly */ +#ifndef BT_LIB_LOG_SUPPORTED +# error Please include "lib/logging.h" before including this file. +#endif + typedef struct bt_stream *(*get_stream_func)( struct bt_message *message); @@ -74,10 +79,8 @@ struct bt_message *bt_message_create_from_pool( struct bt_message *msg = bt_object_pool_create_object(pool); if (G_UNLIKELY(!msg)) { -#ifdef BT_LIB_LOGE BT_LIB_LOGE("Cannot allocate one message from message pool: " "%![pool-]+o, %![graph-]+g", pool, graph); -#endif goto error; }