#define BT_COMP_LOG_SELF_COMP self_comp
#define BT_LOG_OUTPUT_LEVEL log_level
#define BT_LOG_TAG "PLUGIN/SRC.CTF.LTTNG-LIVE"
-#include "plugins/comp-logging.h"
+#include "logging/comp-logging.h"
#include <glib.h>
#include <inttypes.h>
lttng_live_msg_iter->viewer_connection =
live_viewer_connection_create(lttng_live->params.url->str, false,
- lttng_live_msg_iter);
+ lttng_live_msg_iter, log_level);
if (!lttng_live_msg_iter->viewer_connection) {
goto error;
}
SESS_NOT_FOUND_ACTION_END_STR,
lttng_live->params.url->str);
break;
+ case SESSION_NOT_FOUND_ACTION_UNKNOWN:
+ default:
+ /* Fallthrough */
+ BT_COMP_LOGE("Unknown action for session not found"
+ "error. Fail the message iterator"
+ "initialization because of %s=\"%s\" "
+ "component parameter: url =\"%s\"",
+ SESS_NOT_FOUND_ACTION_PARAM,
+ SESS_NOT_FOUND_ACTION_FAIL_STR,
+ lttng_live->params.url->str);
+ break;
}
}
url = bt_value_string_get(url_value);
- viewer_connection = live_viewer_connection_create(url, true, NULL);
+ viewer_connection = live_viewer_connection_create(url, true, NULL,
+ log_level);
if (!viewer_connection) {
goto error;
}
BT_HIDDEN
bt_component_class_query_method_status lttng_live_query(
bt_self_component_class_source *comp_class,
- const bt_query_executor *query_exec,
+ bt_private_query_executor *priv_query_exec,
const char *object, const bt_value *params,
- bt_logging_level log_level, const bt_value **result)
+ __attribute__((unused)) void *method_data,
+ const bt_value **result)
{
bt_component_class_query_method_status status =
BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK;
bt_self_component *self_comp = NULL;
+ bt_logging_level log_level = bt_query_executor_get_logging_level(
+ bt_private_query_executor_as_query_executor_const(
+ priv_query_exec));
if (strcmp(object, "sessions") == 0) {
status = lttng_live_query_list_sessions(params, result,
} else if (strcmp(no_session_act_str, SESS_NOT_FOUND_ACTION_END_STR) == 0) {
action = SESSION_NOT_FOUND_ACTION_END;
} else {
- action = -1;
+ action = SESSION_NOT_FOUND_ACTION_UNKNOWN;
}
return action;
if (value && bt_value_is_string(value)) {
lttng_live->params.sess_not_found_act =
parse_session_not_found_action_param(value);
- if (lttng_live->params.sess_not_found_act == -1) {
+ if (lttng_live->params.sess_not_found_act == SESSION_NOT_FOUND_ACTION_UNKNOWN) {
BT_COMP_LOGE("Unexpected value for `%s` parameter: "
"value=\"%s\"", SESS_NOT_FOUND_ACTION_PARAM,
bt_value_string_get(value));