Opened 5 years ago

Closed 22 months ago

#3800 closed enhancement (fixed)

Make log categories and log levels in runtime consistent

Reported by: toivo Owned by: efredriksson
Priority: major Milestone: Pending
Component: FMI/Export Version: trunk
Keywords: Cc:

Description

Currently, there are two ways to talk about the log level of a log message in the runtime:

  • The category logError/logWarning/logInfo is supplied on each logging invocation. These enum values currently correspond to 0, 1, 2.
  • The log level is supplied to the runtime to filter log messages.
    • logError is always emitted.
    • logWarning is emitted at log level >= 3.
    • logInfo is emitted at log level >= 4.

A number of log messages are emitted only at some loge level higher than 4. These currently need manual filtering based on the log level before calling into the logging framework.

If the log categories were made consistent with the log levels, e.g.

logError = 2,
logWarning = 3,
logInfo = 4,

then we would only have one system of categories to keep track of.
It would also allow to pass log levels > 4 as categories to avoid the need for manual filtering everywhere.

Change History (9)

comment:1 Changed 5 years ago by toivo

Allow to pass a log level >= 4 instead of a jmi_log_category_t as category to logging functions, in r6526.
If such a category is encountered:

  • Filter the category by the current log level.
  • Pass the category on as logInfo to the outside.

This interim solution should allow to pass log levels >= 4 as a category without causing any upsets in external code, and should leave current use unaffected.

comment:2 Changed 5 years ago by toivo

Fix a mistake in r6526 that prevented extended log categories to be emitted through the runtime_log_to_file option, in r6529.

comment:3 Changed 5 years ago by toivo

Fix mistake in r6526 that gave category="" for log nodes with extended categories, in r6530.

comment:4 Changed 5 years ago by toivo

Status: newaccepted

comment:5 Changed 5 years ago by toivo

Milestone: 1.15.x1.16.x

This might have to wait since the best resolution is unclear.

comment:6 Changed 4 years ago by toivo

Milestone: 1.16.x1.17.x

comment:7 Changed 4 years ago by toivo

Owner: changed from toivo to efredriksson
Status: acceptedassigned

comment:8 Changed 4 years ago by efredriksson

Milestone: 1.17.xPending

comment:9 Changed 22 months ago by Jesper Mattsson

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.