Skip to content

Feature Request: Add level number/value to the logged fields. #66

@exhuma

Description

@exhuma

Currently, the emitted messages only contain level names (f.ex. ERROR, CRITICAL, ...). Those names correspond to level values. Those names can be converted to/from their numeric values using logging.getLevelName. Additionally, the numeric values should be available on the log-record behind the attribute levelno:

>>> from logging import LogRecord
>>> import logging
>>> r = LogRecord('foo', logging.DEBUG, 'path', 11, 'msg', {}, False)
>>> r.levelno
10
>>> r.levelname
'DEBUG'

Adding the numeric level value makes it much easier to filter on the severity by simply filtering on everything greater than 40 for example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions