static const char* log_level_env_var_names[] = {
"BABELTRACE_PLUGIN_CTF_METADATA_LOG_LEVEL",
"BABELTRACE_PYTHON_BT2_LOG_LEVEL",
- "BABELTRACE_SINK_TEXT_DETAILS_LOG_LEVEL",
"BABELTRACE_SRC_CTF_FS_LOG_LEVEL",
NULL,
};
details.c details.h \
write.c write.h \
obj-lifetime-mgmt.c obj-lifetime-mgmt.h \
- colors.h \
- logging.c logging.h
+ colors.h
* 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>
}
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);
goto error;
}
- details_comp = create_details_comp();
+ details_comp = create_details_comp(comp);
if (!details_comp) {
status = BT_SELF_COMPONENT_STATUS_NOMEM;
goto error;
/* A `sink.text.details` component */
struct details_comp {
+ bt_logging_level log_level;
+
/* Component's configuration */
struct {
/* Write metadata objects */
+++ /dev/null
-/*
- * Copyright (c) 2019 Philippe Proulx <pproulx@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#define BT_LOG_OUTPUT_LEVEL bt_plugin_text_details_log_level
-#include "logging/log.h"
-
-BT_LOG_INIT_LOG_LEVEL(bt_plugin_text_details_log_level,
- "BABELTRACE_SINK_TEXT_DETAILS_LOG_LEVEL");
+++ /dev/null
-#ifndef BABELTRACE_PLUGINS_TEXT_DETAILS_LOGGING_H
-#define BABELTRACE_PLUGINS_TEXT_DETAILS_LOGGING_H
-
-/*
- * Copyright (c) 2019 Philippe Proulx <pproulx@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#define BT_LOG_OUTPUT_LEVEL bt_plugin_text_details_log_level
-#include "logging/log.h"
-
-BT_LOG_LEVEL_EXTERN_SYMBOL(bt_plugin_text_details_log_level);
-
-#endif /* BABELTRACE_PLUGINS_TEXT_DETAILS_LOGGING_H */