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:42:03 +0000 (13:42 -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.c
src/common/event-rule/log4j-logging.c
src/common/event-rule/python-logging.c

index ddaa7ba696f67b2070fd6dd4b22d77d5cfe9c6ac..12e8be954d92e9e0cd953c8152ecfe04a5ea8686 100644 (file)
@@ -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;
 
index b4d67667dffc8a170e184e183a1f1d89a9c6e588..c5267b9a53edcaeb965f5030c512d0344c4e9f8c 100644 (file)
@@ -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;
 
index 171de4647bb45ee4184fc522a7abe4bae8befaf7..390d3c6acbb296b8a0906227d6ab3f3bc8f3f120 100644 (file)
@@ -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;
 
This page took 0.02754 seconds and 4 git commands to generate.