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:
10
main.py
10
main.py
@ -11,10 +11,13 @@ import yaml
|
|||||||
@singleton
|
@singleton
|
||||||
class Main():
|
class Main():
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def init_log_handlers(self):
|
||||||
|
|
||||||
with open(".env.yaml", "r") as file:
|
with open(".env.yaml", "r") as file:
|
||||||
config = yaml.safe_load(file)
|
config = yaml.safe_load(file)
|
||||||
|
if config["log"] is None:
|
||||||
|
return
|
||||||
|
if config["log"]["handlers"] is None:
|
||||||
|
return
|
||||||
log_handler_confg = config["log"]["handlers"]
|
log_handler_confg = config["log"]["handlers"]
|
||||||
log_handlers = []
|
log_handlers = []
|
||||||
for handler_config in log_handler_confg:
|
for handler_config in log_handler_confg:
|
||||||
@ -31,6 +34,9 @@ class Main():
|
|||||||
))
|
))
|
||||||
logging.basicConfig(level=logging.DEBUG, handlers=log_handlers)
|
logging.basicConfig(level=logging.DEBUG, handlers=log_handlers)
|
||||||
logging.info("logging init finish")
|
logging.info("logging init finish")
|
||||||
|
|
||||||
|
def __init__(self) -> None:
|
||||||
|
self.init_log_handlers()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|||||||
Reference in New Issue
Block a user