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-Tag: v2.13.11~9 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=edbac916fd984b0b50dc3f7cc352a94cb7f24287;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.c b/src/common/event-rule/jul-logging.c index ddaa7ba69..12e8be954 100644 --- a/src/common/event-rule/jul-logging.c +++ b/src/common/event-rule/jul-logging.c @@ -442,7 +442,7 @@ static struct lttng_event *lttng_event_rule_jul_logging_generate_lttng_event( 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.c b/src/common/event-rule/log4j-logging.c index b4d67667d..c5267b9a5 100644 --- a/src/common/event-rule/log4j-logging.c +++ b/src/common/event-rule/log4j-logging.c @@ -442,7 +442,7 @@ static struct lttng_event *lttng_event_rule_log4j_logging_generate_lttng_event( 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.c b/src/common/event-rule/python-logging.c index 171de4647..390d3c6ac 100644 --- a/src/common/event-rule/python-logging.c +++ b/src/common/event-rule/python-logging.c @@ -442,7 +442,7 @@ static struct lttng_event *lttng_event_rule_python_logging_generate_lttng_event( 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;