`ctf` plugin: metadata: use BT_COMP_LOG*() instead of BT_LOG*()
[babeltrace.git] / src / plugins / ctf / common / metadata / logging.h
index dbd00474048ac004e7c74d884784724dca66e6c7..0d60cd36428d8fc2d28851cfa92a2eacfebefecd 100644 (file)
@@ -23,6 +23,7 @@
  * SOFTWARE.
  */
 
+#include <babeltrace2/babeltrace.h>
 #include "logging/log.h"
 
 /*
  */
 BT_LOG_LEVEL_EXTERN_SYMBOL(ctf_plugin_metadata_log_level);
 
+/*
+ * To be used by functions without a context structure to pass all the
+ * logging configuration at once.
+ */
+struct meta_log_config {
+       bt_logging_level log_level;
+
+       /* Weak */
+       bt_self_component *self_comp;
+};
+
 #define _BT_LOGV_LINENO(_lineno, _msg, args...) \
        BT_LOGV("At line %u in metadata stream: " _msg, _lineno, ## args)
 
@@ -40,4 +52,13 @@ BT_LOG_LEVEL_EXTERN_SYMBOL(ctf_plugin_metadata_log_level);
 #define _BT_LOGE_LINENO(_lineno, _msg, args...) \
        BT_LOGE("At line %u in metadata stream: " _msg, _lineno, ## args)
 
+#define _BT_COMP_LOGV_LINENO(_lineno, _msg, args...) \
+       BT_COMP_LOGV("At line %u in metadata stream: " _msg, _lineno, ## args)
+
+#define _BT_COMP_LOGW_LINENO(_lineno, _msg, args...) \
+       BT_COMP_LOGW("At line %u in metadata stream: " _msg, _lineno, ## args)
+
+#define _BT_COMP_LOGE_LINENO(_lineno, _msg, args...) \
+       BT_COMP_LOGE("At line %u in metadata stream: " _msg, _lineno, ## args)
+
 #endif /* CTF_METADATA_LOGGING_H */
This page took 0.024455 seconds and 4 git commands to generate.