sink.ctf.fs: honor component's initial log level
[babeltrace.git] / src / cli / babeltrace2.c
index d4145f1de22895928869efc58f17d935533e925b..d3cabdc920be1e079e92dce1993bf440c05bbb31 100644 (file)
  * modules.
  */
 static const char* log_level_env_var_names[] = {
-       "BABELTRACE_COMMON_LOG_LEVEL",
-       "BABELTRACE_COMPAT_LOG_LEVEL",
-       "BABELTRACE_CTFSER_LOG_LEVEL",
-       "BABELTRACE_FD_CACHE_LOG_LEVEL",
-       "BABELTRACE_FLT_LTTNG_UTILS_DEBUG_INFO_LOG_LEVEL",
-       "BABELTRACE_FLT_UTILS_COUNTER_LOG_LEVEL",
-       "BABELTRACE_FLT_UTILS_MUXER_LOG_LEVEL",
-       "BABELTRACE_FLT_UTILS_TRIMMER_LOG_LEVEL",
-       "BABELTRACE_PLUGIN_CTF_BFCR_LOG_LEVEL",
        "BABELTRACE_PLUGIN_CTF_METADATA_LOG_LEVEL",
-       "BABELTRACE_PLUGIN_CTF_MSG_ITER_LOG_LEVEL",
-       "BABELTRACE_PLUGIN_CTF_UTILS_LOG_LEVEL",
        "BABELTRACE_PYTHON_BT2_LOG_LEVEL",
-       "BABELTRACE_SINK_CTF_FS_LOG_LEVEL",
        "BABELTRACE_SINK_TEXT_DETAILS_LOG_LEVEL",
        "BABELTRACE_SRC_CTF_FS_LOG_LEVEL",
-       "BABELTRACE_SRC_CTF_LTTNG_LIVE_LOG_LEVEL",
-       "BABELTRACE_SRC_TEXT_DMESG_LOG_LEVEL",
        NULL,
 };
 
@@ -171,9 +157,9 @@ void destroy_the_query_executor(void)
 }
 
 static
-int query(const bt_component_class *comp_cls, const char *obj,
-               const bt_value *params, const bt_value **user_result,
-               const char **fail_reason)
+int query(struct bt_config *cfg, const bt_component_class *comp_cls,
+               const char *obj, const bt_value *params,
+               const bt_value **user_result, const char **fail_reason)
 {
        const bt_value *result = NULL;
        bt_query_executor_status status;
@@ -199,7 +185,7 @@ int query(const bt_component_class *comp_cls, const char *obj,
 
        while (true) {
                status = bt_query_executor_query(the_query_executor,
-                       comp_cls, obj, params, &result);
+                       comp_cls, obj, params, cfg->log_level, &result);
                switch (status) {
                case BT_QUERY_EXECUTOR_STATUS_OK:
                        goto ok;
@@ -968,7 +954,7 @@ int cmd_query(struct bt_config *cfg)
                goto end;
        }
 
-       ret = query(comp_cls, cfg->cmd_data.query.object->str,
+       ret = query(cfg, comp_cls, cfg->cmd_data.query.object->str,
                cfg->cmd_data.query.cfg_component->params,
                &results, &fail_reason);
        if (ret) {
@@ -1264,7 +1250,7 @@ int cmd_print_lttng_live_sessions(struct bt_config *cfg)
                goto error;
        }
 
-       ret = query(comp_cls, "sessions", params,
+       ret = query(cfg, comp_cls, "sessions", params,
                    &results, &fail_reason);
        if (ret) {
                goto failed;
@@ -1418,7 +1404,7 @@ int cmd_print_ctf_metadata(struct bt_config *cfg)
                goto end;
        }
 
-       ret = query(comp_cls, "metadata-info",
+       ret = query(cfg, comp_cls, "metadata-info",
                params, &results, &fail_reason);
        if (ret) {
                goto failed;
@@ -2177,7 +2163,7 @@ int set_stream_intersections(struct cmd_run_ctx *ctx,
        const bt_component_class *comp_cls =
                bt_component_class_source_as_component_class_const(src_comp_cls);
 
-       ret = query(comp_cls, "trace-info",
+       ret = query(ctx->cfg, comp_cls, "trace-info",
                cfg_comp->params, &query_result,
                &fail_reason);
        if (ret) {
This page took 0.025302 seconds and 4 git commands to generate.