The fact that LogRecord is defined as a type alias that is not logging.LogRecord while logging.LogRecord is also thrown around (e.g. in add_fields) is very confusing.
|
LogRecord: TypeAlias = Dict[str, Any] |
I strongly advise to pick a different name for this to differentiate it from the logging class, for example LogDict. This is also a strong contender for v4 imo.
The fact that
LogRecordis defined as a type alias that is notlogging.LogRecordwhilelogging.LogRecordis also thrown around (e.g. inadd_fields) is very confusing.python-json-logger/src/pythonjsonlogger/core.py
Line 78 in e7761e5
I strongly advise to pick a different name for this to differentiate it from the logging class, for example
LogDict. This is also a strong contender for v4 imo.