Project

General

Profile

Actions

Bug #998

closed

UST and Java/Python log levels are not ordered the same way

Added by Philippe Proulx over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Target version:
Start date:
02/29/2016
Due date:
% Done:

0%

Estimated time:

Description

From 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

Notice how 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.

The --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_NOTSET, PYTHON_DEBUG, PYTHON_INFO, and PYTHON_WARNING, whereas you would normally expect to get PYTHON_WARNING, PYTHON_ERROR, and PYTHON_CRITICAL events.

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:

  • [0, LOGLEVEL] for TRACE_* log levels (UST domain);
  • [LOGLEVEL, infinity[ for Java/Python/(future, I guess) log levels (agent domain).
Actions

Also available in: Atom PDF