blackmamba.log¶
Logging module.
This module must not introduce dependency on any other Black Mamba modules and must be importable on any other platform.
Why custom module instead of the bundled one? Several reasons:
- not to interfere with Pythonista logging settings,
- unable to convince Pythonista to use my colors,
- etc.
Default log level is INFO. You can use blackmamba.log.set_level
to change effective log level. Available log levels are:
If you’d like to silent Black Mamba messages, it’s recommended to set log
level to ERROR
:
import blackmamba.log as log
log.set_level(log.ERROR)
-
blackmamba.log.
ERROR
= 40¶ Only errors are logged.
-
blackmamba.log.
WARNING
= 30¶ Only warnings and errors are logged.
-
blackmamba.log.
INFO
= 20¶ Informational messages, warnings and errors are logged.
-
blackmamba.log.
DEBUG
= 10¶ Debug, information messages, warnings and errors are logged.
-
blackmamba.log.
NOTSET
= 0¶ All messages are logged.
-
blackmamba.log.
set_level
(level: int)[source]¶ Set effective log level.
Parameters: level – Log level to set.