Don't assume that Log4j and JUL share the same log level mappings
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 31 Aug 2015 22:32:16 +0000 (18:32 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 1 Sep 2015 16:03:08 +0000 (12:03 -0400)
We explicitly set the log level of Log4j events to
LTTNG_LOGLEVEL_LOG4J_ALL instead of relying on the fact that
LTTNG_LOGLEVEL_LOG4J_ALL and LTTNG_LOGLEVEL_JUL_ALL are mapped to the
same value.

The resulting additional branch does not seem to incur a significant
performance penalty and, as such, is deemed acceptable.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/enable_events.c

index 334e00cbce0c22d8d2fe78289f6822bbc65c1761..0e4fdc61ed3e6391e0c5bde0c5a9c943c70fb91a 100644 (file)
@@ -781,8 +781,10 @@ static int enable_events(char *session_name)
                                assert(opt_userspace || opt_jul || opt_log4j || opt_python);
                                if (opt_userspace) {
                                        ev.loglevel = -1;
                                assert(opt_userspace || opt_jul || opt_log4j || opt_python);
                                if (opt_userspace) {
                                        ev.loglevel = -1;
-                               } else if (opt_jul || opt_log4j) {
+                               } else if (opt_jul) {
                                        ev.loglevel = LTTNG_LOGLEVEL_JUL_ALL;
                                        ev.loglevel = LTTNG_LOGLEVEL_JUL_ALL;
+                               } else if (opt_log4j) {
+                                       ev.loglevel = LTTNG_LOGLEVEL_LOG4J_ALL;
                                } else if (opt_python) {
                                        ev.loglevel = LTTNG_LOGLEVEL_PYTHON_DEBUG;
                                }
                                } else if (opt_python) {
                                        ev.loglevel = LTTNG_LOGLEVEL_PYTHON_DEBUG;
                                }
This page took 0.025577 seconds and 4 git commands to generate.