From: Jérémie Galarneau Date: Fri, 14 Jul 2023 21:26:26 +0000 (-0400) Subject: event-rule: set event rule loglevel to domain specific value when unset X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5983bb6d3d405e34c690bf33d861f143fb16f8ce;p=lttng-tools.git event-rule: set event rule loglevel to domain specific value when unset The various domains that support log levels define different values for ALL/UNSET that are not -1. Using these domain values makes reasoning about the code simpler as -1 does not necessarily have a defined meaning in all domains. Signed-off-by: Jérémie Galarneau Change-Id: I2e818d42f72d3b12e44e375ce30367bf1f6d5463 --- diff --git a/src/common/event-rule/jul-logging.cpp b/src/common/event-rule/jul-logging.cpp index 95b953e17..97876cd35 100644 --- a/src/common/event-rule/jul-logging.cpp +++ b/src/common/event-rule/jul-logging.cpp @@ -413,7 +413,7 @@ lttng_event_rule_jul_logging_generate_lttng_event(const struct lttng_event_rule status = lttng_event_rule_jul_logging_get_log_level_rule(rule, &log_level_rule); if (status == LTTNG_EVENT_RULE_STATUS_UNSET) { loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL; - loglevel_value = -1; + loglevel_value = LTTNG_LOGLEVEL_JUL_ALL; } else if (status == LTTNG_EVENT_RULE_STATUS_OK) { enum lttng_log_level_rule_status llr_status; diff --git a/src/common/event-rule/log4j-logging.cpp b/src/common/event-rule/log4j-logging.cpp index a3184d6d0..ba440b979 100644 --- a/src/common/event-rule/log4j-logging.cpp +++ b/src/common/event-rule/log4j-logging.cpp @@ -413,7 +413,7 @@ lttng_event_rule_log4j_logging_generate_lttng_event(const struct lttng_event_rul status = lttng_event_rule_log4j_logging_get_log_level_rule(rule, &log_level_rule); if (status == LTTNG_EVENT_RULE_STATUS_UNSET) { loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL; - loglevel_value = -1; + loglevel_value = LTTNG_LOGLEVEL_LOG4J_ALL; } else if (status == LTTNG_EVENT_RULE_STATUS_OK) { enum lttng_log_level_rule_status llr_status; diff --git a/src/common/event-rule/python-logging.cpp b/src/common/event-rule/python-logging.cpp index 2a5703da2..9fcfaba9c 100644 --- a/src/common/event-rule/python-logging.cpp +++ b/src/common/event-rule/python-logging.cpp @@ -413,7 +413,7 @@ lttng_event_rule_python_logging_generate_lttng_event(const struct lttng_event_ru status = lttng_event_rule_python_logging_get_log_level_rule(rule, &log_level_rule); if (status == LTTNG_EVENT_RULE_STATUS_UNSET) { loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL; - loglevel_value = -1; + loglevel_value = LTTNG_LOGLEVEL_PYTHON_NOTSET; } else if (status == LTTNG_EVENT_RULE_STATUS_OK) { enum lttng_log_level_rule_status llr_status;