lib: plugin.h: force header user to include "lib/logging.h"
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 14 Jun 2019 21:12:36 +0000 (17:12 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 20 Jun 2019 18:01:16 +0000 (14:01 -0400)
This pattern is found in other headers where, instead of including the
logging header for the user, we ask her to set up the logging and then
include the header.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I922b09f63eff41b9c3ba30df7ace0b8b30b5b5b2
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1443
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
src/lib/plugin/plugin.h
src/python-plugin-provider/python-plugin-provider.c

index d62bfb55f0812de59d7575c7f172908ef7cf2cf1..6d9b288d8f5c997221bec3baab853b7c441d76c7 100644 (file)
 #include "lib/object.h"
 #include <babeltrace2/types.h>
 #include "common/assert.h"
-#include "lib/lib-logging.h"
 #include <glib.h>
 
 #include "plugin-so.h"
 
+/* Protection: this file uses BT_LIB_LOG*() macros directly */
+#ifndef BABELTRACE_LIB_LOGGING_INTERNAL_H
+# error Please include "lib/lib-logging.h" before including this file.
+#endif
+
 enum bt_plugin_type {
        BT_PLUGIN_TYPE_SO = 0,
        BT_PLUGIN_TYPE_PYTHON = 1,
index b4bbff475421326b97983da83cc01022d6d8322a..7ca264b4d808d01d3b7fbb3865495261b8bf4821 100644 (file)
@@ -26,6 +26,7 @@
 
 #define BT_LOG_TAG "PLUGIN-PY"
 
+#include "lib/lib-logging.h"
 #include "common/macros.h"
 #include "compat/compiler.h"
 #include <babeltrace2/plugin/plugin-const.h>
This page took 0.026866 seconds and 4 git commands to generate.