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
|
||||
class Main():
|
||||
|
||||
def __init__(self) -> None:
|
||||
|
||||
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
|
||||
log_handler_confg = config["log"]["handlers"]
|
||||
log_handlers = []
|
||||
for handler_config in log_handler_confg:
|
||||
@ -32,6 +35,9 @@ class Main():
|
||||
logging.basicConfig(level=logging.DEBUG, handlers=log_handlers)
|
||||
logging.info("logging init finish")
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.init_log_handlers()
|
||||
|
||||
def run(self):
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.info("jarvis-models start", extra={"version": "0.0.1"})
|
||||
|
||||
Reference in New Issue
Block a user