loggers
Loggers for the various EnderChest actions
CLIFormatter
Bases: Formatter
Colorful formatter for the CLI
h/t https://stackoverflow.com/a/56944256
Source code in enderchest/loggers.py
verbosity_to_log_level(verbosity)
Convert a verbosity level (number of -v
s minus number of -q
s) to
a logging level
Parameters:
Name | Type | Description | Default |
---|---|---|---|
verbosity |
int
|
A verbosity level usually specified by the number of |
required |
Returns:
Type | Description |
---|---|
int
|
The corresponding log level that should be set |
Notes
Technically the default logging level is set just high enough to exclude
DEBUG by default. This allows us to capture intermediate log levels (read:
IMPORTANT
) at the verbosity = -1
(-q
) level.