with the library
import logging
when I use the method .error(text) or .warning(text), the logger writes the log level as INFO, WARNING, ERROR, etc.
I was wondering if there is a way to change the WARNING string, for example, to WARN (and change ERROR as ERR, instead).
TLDR; I want to change the Text logging level for the message ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL') in whatever I like... Is there a way to do that?
That comes out of the box in the logging module, with the addLevelName function:
logging.addLevelName(logging.WARNING, "WARN")
logging.addLevelName(logging.ERROR, "ERR")
Those name will be used by all the formatters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With