sink.text.details: honor component's initial log level
[babeltrace.git] / src / plugins / text / details / details.c
index 8f09efa4050572ffc427c717b9d1a6aa162ff8e1..8c1f66e38a52ab1b3e99e8b58451e960b62c91c7 100644 (file)
@@ -20,8 +20,9 @@
  * SOFTWARE.
  */
 
+#define BT_LOG_OUTPUT_LEVEL (details_comp->log_level)
 #define BT_LOG_TAG "PLUGIN/SINK.TEXT.DETAILS"
-#include "logging.h"
+#include "logging/log.h"
 
 #include <babeltrace2/babeltrace.h>
 
@@ -181,14 +182,19 @@ end:
 }
 
 static
-struct details_comp *create_details_comp(void)
+struct details_comp *create_details_comp(
+               bt_self_component_sink *self_comp_sink)
 {
        struct details_comp *details_comp = g_new0(struct details_comp, 1);
+       bt_self_component *self_comp =
+               bt_self_component_sink_as_self_component(self_comp_sink);
 
        if (!details_comp) {
                goto error;
        }
 
+       details_comp->log_level = bt_component_get_logging_level(
+               bt_self_component_as_component(self_comp));
        details_comp->meta = g_hash_table_new_full(g_direct_hash,
                g_direct_equal, NULL,
                (GDestroyNotify) details_destroy_details_trace_class_meta);
@@ -392,7 +398,7 @@ bt_self_component_status details_init(bt_self_component_sink *comp,
                goto error;
        }
 
-       details_comp = create_details_comp();
+       details_comp = create_details_comp(comp);
        if (!details_comp) {
                status = BT_SELF_COMPONENT_STATUS_NOMEM;
                goto error;
This page took 0.023946 seconds and 4 git commands to generate.