Closed
Description
There needs to be another way to set defaults.
Environmental variables do not work for everything on Windows.
For example:
If I do not want any color for INFO
level, I cannot set environment variable LOGURU_INFO_COLOR=""
because then it's disabled on Windows.
I cannot do:
_defaults.LOGURU_INFO_COLOR = ""
Since logger is already initialized.
Instead, I have to do extremely hacky stuff like:
from loguru import _defaults, logger
from loguru._logger import Level
logger.info('bold')
logger._levels['INFO'] = Level(_defaults.LOGURU_INFO_NO, "", _defaults.LOGURU_INFO_ICON)
logger.info('not bold')
Since Level
is a namedtuple, I cannot even modify it in-place
Perhaps a config file or an .ini
file as well would be better.