UST and Java/Python log levels are not ordered the same way
lttng enable-event --help:
Available loglevels: TRACE_EMERG = 0 TRACE_ALERT = 1 TRACE_CRIT = 2 TRACE_ERR = 3 TRACE_WARNING = 4 TRACE_NOTICE = 5 TRACE_INFO = 6 TRACE_DEBUG_SYSTEM = 7 TRACE_DEBUG_PROGRAM = 8 TRACE_DEBUG_PROCESS = 9 TRACE_DEBUG_MODULE = 10 TRACE_DEBUG_UNIT = 11 TRACE_DEBUG_FUNCTION = 12 TRACE_DEBUG_LINE = 13 TRACE_DEBUG = 14 (shortcuts such as "system" are allowed) Available JUL domain loglevels: JUL_OFF = INT32_MAX JUL_SEVERE = 1000 JUL_WARNING = 900 JUL_INFO = 800 JUL_CONFIG = 700 JUL_FINE = 500 JUL_FINER = 400 JUL_FINEST = 300 JUL_ALL = INT32_MIN (shortcuts such as "severe" are allowed) Available LOG4j domain loglevels: LOG4J_OFF = INT32_MAX LOG4J_FATAL = 50000 LOG4J_ERROR = 40000 LOG4J_WARN = 30000 LOG4J_INFO = 20000 LOG4J_DEBUG = 10000 LOG4J_TRACE = 5000 LOG4J_ALL = INT32_MIN (shortcuts such as "severe" are allowed) Available Python domain loglevels: PYTHON_CRITICAL = 50 PYTHON_ERROR = 40 PYTHON_WARNING = 30 PYTHON_INFO = 20 PYTHON_DEBUG = 10 PYTHON_NOTSET = 0
TRACE_* log levels are more severe when the numeric level is lower, and Java/Python log levels are more severe when the numeric level is higher.
--loglevel option's help says:
Tracepoint loglevel range from 0 to loglevel.
Using this option with Java/Python events is not intuitive: if you specify
PYTHON_WARNING, for example, you get events with log levels
PYTHON_WARNING, whereas you would normally expect to get
I suggest the option's help is changed to something like:
--loglevel LOGLEVEL Enable event if its log level is at least as severe as LOGLEVEL.
The code should be changed to check if the event's log level is in range:
TRACE_*log levels (UST domain);
LOGLEVEL, infinity[ for Java/Python/(future, I guess) log levels (agent domain).
Updated by Philippe Proulx about 4 years ago
- Status changed from Confirmed to Resolved
The correct operators are used for both the UST and agent domains, so this seems to work.
It was mostly a documentation issue in the end, but I reworded the
--loglevel option's description while refactoring the man pages, so this is resolved.