X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Fctf%2Flttng-live%2Flttng-live.c;h=33cd94a00280d6480ed6cce397594b526514fb76;hb=020bc26fec456cd471efdcd92a9c86bdc1b42fa6;hp=ac7d35249f8c60ff62179f68d8d631020dc9242f;hpb=3cdf42341335fa72046de8514b38c6fa76460f3b;p=babeltrace.git diff --git a/plugins/ctf/lttng-live/lttng-live.c b/plugins/ctf/lttng-live/lttng-live.c index ac7d3524..33cd94a0 100644 --- a/plugins/ctf/lttng-live/lttng-live.c +++ b/plugins/ctf/lttng-live/lttng-live.c @@ -27,6 +27,9 @@ * SOFTWARE. */ +#define BT_LOG_TAG "PLUGIN-CTF-LTTNG-LIVE-SRC" +#include "logging.h" + #include #include #include @@ -48,9 +51,6 @@ #include #include -#define BT_LOG_TAG "PLUGIN-CTF-LTTNG-LIVE" -#define BT_LOGLEVEL_NAME "BABELTRACE_PLUGIN_CTF_LTTNG_LIVE_LOG_LEVEL" - #include "data-stream.h" #include "metadata.h" #include "lttng-live-internal.h" @@ -83,9 +83,6 @@ static const char *print_state(struct lttng_live_stream_iterator *s) print_state(stream), stream->last_returned_inactivity_timestamp, \ stream->current_inactivity_timestamp) -BT_HIDDEN -int bt_lttng_live_log_level = BT_LOG_NONE; - BT_HIDDEN int lttng_live_add_port(struct lttng_live_component *lttng_live, struct lttng_live_stream_iterator *stream_iter) @@ -1117,35 +1114,3 @@ end: bt_put(self_port); return status; } - -static -void __attribute__((constructor)) bt_lttng_live_logging_ctor(void) -{ - enum bt_logging_level log_level = BT_LOG_NONE; - const char *log_level_env = getenv(BT_LOGLEVEL_NAME); - - if (!log_level_env) { - return; - } - - if (strcmp(log_level_env, "VERBOSE") == 0) { - log_level = BT_LOGGING_LEVEL_VERBOSE; - } else if (strcmp(log_level_env, "DEBUG") == 0) { - log_level = BT_LOGGING_LEVEL_DEBUG; - } else if (strcmp(log_level_env, "INFO") == 0) { - log_level = BT_LOGGING_LEVEL_INFO; - } else if (strcmp(log_level_env, "WARN") == 0) { - log_level = BT_LOGGING_LEVEL_WARN; - } else if (strcmp(log_level_env, "ERROR") == 0) { - log_level = BT_LOGGING_LEVEL_ERROR; - } else if (strcmp(log_level_env, "FATAL") == 0) { - log_level = BT_LOGGING_LEVEL_FATAL; - } else { - bt_lttng_live_log_level = BT_LOGGING_LEVEL_FATAL; - BT_LOGF("Incorrect log level specified in %s", - BT_LOGLEVEL_NAME); - abort(); - } - - bt_lttng_live_log_level = log_level; -}