Skip to content
Snippets Groups Projects
Commit 549af640 authored by Tim Repke's avatar Tim Repke
Browse files

fix logging config

parent f3f152ab
No related branches found
No related tags found
No related merge requests found
Pipeline #779 passed
......@@ -111,11 +111,12 @@ class Settings(BaseSettings):
def read_logging_config(cls, v: dict[str, Any] | None, values: dict[str, str]) -> dict[str, Any]:
if isinstance(v, dict):
return v
filename = values.get('LOG_CONF_FILE', cls.LOG_CONF_FILE)
with open(filename, 'r') as f:
ret = yaml.safe_load(f.read())
if type(ret) == dict:
return ret
filename = values.get('LOG_CONF_FILE', None)
if filename is not None:
with open(filename, 'r') as f:
ret = yaml.safe_load(f.read())
if type(ret) == dict:
return ret
raise ValueError('Logging config invalid!')
class Config:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment