mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-09-20 10:41:14 +00:00
Config: Don't fail on config error, fix Windows config dir (#426)
* Support setting logger level (env) before config load.
This commit is contained in:
committed by
GitHub
parent
da4994ca39
commit
d05b161e24
@@ -52,6 +52,10 @@ def get_logger(
|
||||
# Create a logger with the specified name
|
||||
logger = pylogging.getLogger(name)
|
||||
logger.propagate = True
|
||||
# This is already supported by pydantic-settings in LoggingCommonSettings, however in case
|
||||
# loading the config itself fails and to set the level before we load the config, we set it here manually.
|
||||
if logging_level is None and (env_level := os.getenv("EOS_LOGGING__LEVEL")) is not None:
|
||||
logging_level = env_level
|
||||
if logging_level is not None:
|
||||
level = logging_str_to_level(logging_level)
|
||||
logger.setLevel(level)
|
||||
|
Reference in New Issue
Block a user