utils.sink.counter: use BT_COMP_LOG*() instead of BT_LOG*()
[babeltrace.git] / src / plugins / utils / counter / counter.c
index 2438a4e02a8c3dc028c5e6c3ee106ca9283151f4..f8561e765bc67ae9c450b35453701254b1cf3e3e 100644 (file)
  * SOFTWARE.
  */
 
+#define BT_COMP_LOG_SELF_COMP (counter->self_comp)
 #define BT_LOG_OUTPUT_LEVEL (counter->log_level)
 #define BT_LOG_TAG "PLUGIN/FLT.UTILS.COUNTER"
-#include "logging/log.h"
+#include "plugins/comp-logging.h"
 
 #include <babeltrace2/babeltrace.h>
 #include "common/macros.h"
@@ -151,9 +152,10 @@ bt_self_component_status counter_init(
                goto error;
        }
 
+       counter->self_comp =
+               bt_self_component_sink_as_self_component(component);
        counter->log_level = bt_component_get_logging_level(
-               bt_self_component_as_component(
-                       bt_self_component_sink_as_self_component(component)));
+               bt_self_component_as_component(counter->self_comp));
        ret = bt_self_component_sink_add_input_port(component,
                "in", NULL, NULL);
        if (ret != BT_SELF_COMPONENT_STATUS_OK) {
@@ -165,7 +167,7 @@ bt_self_component_status counter_init(
        step = bt_value_map_borrow_entry_value_const(params, "step");
        if (step) {
                if (!bt_value_is_unsigned_integer(step)) {
-                       BT_LOGE("`step` parameter: expecting an unsigned integer value: "
+                       BT_COMP_LOGE("`step` parameter: expecting an unsigned integer value: "
                                "type=%s", bt_common_value_type_string(
                                        bt_value_get_type(step)));
                        goto error;
@@ -177,7 +179,7 @@ bt_self_component_status counter_init(
        hide_zero = bt_value_map_borrow_entry_value_const(params, "hide-zero");
        if (hide_zero) {
                if (!bt_value_is_bool(hide_zero)) {
-                       BT_LOGE("`hide-zero` parameter: expecting a boolean value: "
+                       BT_COMP_LOGE("`hide-zero` parameter: expecting a boolean value: "
                                "type=%s", bt_common_value_type_string(
                                        bt_value_get_type(hide_zero)));
                        goto error;
This page took 0.02419 seconds and 4 git commands to generate.