From 34aa3685e3196d6044cc700734f799a112d74a9c Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 31 Aug 2015 18:32:16 -0400 Subject: [PATCH] Don't assume that Log4j and JUL share the same log level mappings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/bin/lttng/commands/enable_events.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bin/lttng/commands/enable_events.c b/src/bin/lttng/commands/enable_events.c index 334e00cbc..0e4fdc61e 100644 --- a/src/bin/lttng/commands/enable_events.c +++ b/src/bin/lttng/commands/enable_events.c @@ -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; - } else if (opt_jul || opt_log4j) { + } else if (opt_jul) { 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; } -- 2.34.1