You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the Logger.log() method with a level number, the log message is generated with Level [number] rather than the name of the severity level. This is different to the behaviour of the builtin logging library and not what I would expect from looking at the implementation.
This is actually by design. When using an integer, the level will be treated as anonymous. This is because there is no way to uniquely identify a level by a integer, since two levels with different names can share the same severity.
Ah that makes a lot of sense. My issue was using this with the tenacity library, specifically the tenacity.before_sleep_log function. But I realised I can just provide the level name instead and it works just fine.
Apologies for the duplicate question. Thanks for your help, and for all your work on Loguru :)
When using the
Logger.log()
method with a level number, the log message is generated withLevel [number]
rather than the name of the severity level. This is different to the behaviour of the builtin logging library and not what I would expect from looking at the implementation.I would expect the output of both log messages to show "DEBUG" as the log severity.
Python 3.10.2
Loguru 0.7.0
The text was updated successfully, but these errors were encountered: