ctx->connect_ports = false;
graph_status = bt_graph_add_filter_component(
ctx->graph, trimmer_class, trimmer_name,
- trimmer_params, &trimmer);
+ trimmer_params, ctx->cfg->log_level,
+ &trimmer);
free(trimmer_name);
if (graph_status != BT_GRAPH_STATUS_OK) {
goto error;
case BT_COMPONENT_CLASS_TYPE_SOURCE:
ret = bt_graph_add_source_component(ctx->graph,
comp_cls, cfg_comp->instance_name->str,
- cfg_comp->params,
+ cfg_comp->params, ctx->cfg->log_level,
(void *) &comp);
break;
case BT_COMPONENT_CLASS_TYPE_FILTER:
ret = bt_graph_add_filter_component(ctx->graph,
comp_cls, cfg_comp->instance_name->str,
- cfg_comp->params,
+ cfg_comp->params, ctx->cfg->log_level,
(void *) &comp);
break;
case BT_COMPONENT_CLASS_TYPE_SINK:
ret = bt_graph_add_sink_component(ctx->graph,
comp_cls, cfg_comp->instance_name->str,
- cfg_comp->params,
+ cfg_comp->params, ctx->cfg->log_level,
(void *) &comp);
break;
default:
*/
if (getenv("BABELTRACE_DEBUG") &&
strcmp(getenv("BABELTRACE_DEBUG"), "1") == 0) {
- cfg->log_level = 'V';
+ cfg->log_level = BT_LOG_VERBOSE;
} else if (getenv("BABELTRACE_VERBOSE") &&
strcmp(getenv("BABELTRACE_VERBOSE"), "1") == 0) {
- cfg->log_level = 'I';
+ cfg->log_level = BT_LOG_INFO;
}
/*
*/
if (!getenv("BABELTRACE_LOGGING_GLOBAL_LEVEL")) {
if (cfg->verbose) {
- bt_logging_set_global_level(BT_LOGGING_LEVEL_INFO);
+ bt_logging_set_global_level(BT_LOG_INFO);
} else if (cfg->debug) {
- bt_logging_set_global_level(BT_LOGGING_LEVEL_VERBOSE);
+ bt_logging_set_global_level(BT_LOG_VERBOSE);
} else {
/*
* Set library's default log level if not
* explicitly specified.
*/
- switch (cfg->log_level) {
- case 'N':
- bt_logging_set_global_level(BT_LOGGING_LEVEL_NONE);
- break;
- case 'V':
- bt_logging_set_global_level(BT_LOGGING_LEVEL_VERBOSE);
- break;
- case 'D':
- bt_logging_set_global_level(BT_LOGGING_LEVEL_DEBUG);
- break;
- case 'I':
- bt_logging_set_global_level(BT_LOGGING_LEVEL_INFO);
- break;
- case 'W':
- bt_logging_set_global_level(BT_LOGGING_LEVEL_WARN);
- break;
- case 'E':
- bt_logging_set_global_level(BT_LOGGING_LEVEL_ERROR);
- break;
- case 'F':
- bt_logging_set_global_level(BT_LOGGING_LEVEL_FATAL);
- break;
- default:
- abort();
- }
+ bt_logging_set_global_level(cfg->log_level);
}
}
* Set CLI's default log level if not explicitly
* specified.
*/
- switch (cfg->log_level) {
- case 'N':
- bt_cli_log_level = BT_LOG_NONE;
- break;
- case 'V':
- bt_cli_log_level = BT_LOG_VERBOSE;
- break;
- case 'D':
- bt_cli_log_level = BT_LOG_DEBUG;
- break;
- case 'I':
- bt_cli_log_level = BT_LOG_INFO;
- break;
- case 'W':
- bt_cli_log_level = BT_LOG_WARN;
- break;
- case 'E':
- bt_cli_log_level = BT_LOG_ERROR;
- break;
- case 'F':
- bt_cli_log_level = BT_LOG_FATAL;
- break;
- default:
- abort();
- }
+ bt_cli_log_level = cfg->log_level;
}
}
* Set module's default log level if not
* explicitly specified.
*/
- val[0] = cfg->log_level;
+ val[0] = bt_log_get_letter_from_level(
+ cfg->log_level);
g_setenv(*env_var_name, val, 1);
}
}