-
Notifications
You must be signed in to change notification settings - Fork 783
No correspondence between string and int level format #209
Copy link
Copy link
Closed
Labels
enhancementImprovement to an already existing featureImprovement to an already existing feature
Description
The behaviors when logging with the level set as "INFO" or 20 is different, though they share the same level number.
I noticed that because I wanted to use logging levels constant:
from logging import INFO
from loguru import logger
logger.log(INFO, "toto")
If the level number is registered in loguru it should be matched and used instead of displaying the generic "Level %d" % level_no message without any colorization.
It would also be nice to have Loguru providing the level numbers as constant (e.g loguru.INFO), otherwise levels are just magic strings that cannot be easily looked up or referenced.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementImprovement to an already existing featureImprovement to an already existing feature
