mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-13 16:53:24 +00:00
fixup
This commit is contained in:
7
main.py
7
main.py
@ -14,10 +14,7 @@ class Main():
|
||||
def init_log_handlers(self):
|
||||
with open(".env.yaml", "r") as file:
|
||||
config = yaml.safe_load(file)
|
||||
if config["log"] is None:
|
||||
return
|
||||
if config["log"]["handlers"] is None:
|
||||
return
|
||||
try:
|
||||
log_handler_confg = config["log"]["handlers"]
|
||||
log_handlers = [logging.StreamHandler()]
|
||||
for handler_config in log_handler_confg:
|
||||
@ -34,6 +31,8 @@ class Main():
|
||||
))
|
||||
logging.basicConfig(level=logging.DEBUG, handlers=log_handlers)
|
||||
logging.info("logging init finish")
|
||||
except KeyError:
|
||||
return
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.init_log_handlers()
|
||||
|
||||
Reference in New Issue
Block a user