event-rule: set event rule loglevel to domain specific value when unset
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 14 Jul 2023 21:26:26 +0000 (17:26 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 19 Jul 2023 17:44:16 +0000 (13:44 -0400)
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 <jeremie.galarneau@efficios.com>
Change-Id: I2e818d42f72d3b12e44e375ce30367bf1f6d5463

src/common/event-rule/jul-logging.cpp
src/common/event-rule/log4j-logging.cpp
src/common/event-rule/python-logging.cpp

index 95b953e17bda9697d19418f8892f53c42545f27a..97876cd35ef782690435316dd1b35f45bdecfc18 100644 (file)
@@ -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;
 
index a3184d6d06a3b1ada2f03a646afcf36a41fed700..ba440b979e1685082558baa73e20660bcc2cc7cc 100644 (file)
@@ -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;
 
index 2a5703da2ab22336a8a557f4be323d33dfcd7860..9fcfaba9c66aad722c7aa8b3c23470c6c651e847 100644 (file)
@@ -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;
 
This page took 0.027301 seconds and 4 git commands to generate.