feat: log

This commit is contained in:
superobk
2024-04-30 17:59:37 +08:00
parent 6b943d9f3d
commit 579c9063b4
4 changed files with 2 additions and 24 deletions

View File

@ -7,12 +7,11 @@ from src.configuration import EnvConf, LogConf, singleton
@singleton
class Main():
env_conf: EnvConf
@inject
def __init__(self, log_config: LogConf, env_conf: EnvConf, log_handler: LogHandler) -> None:
self.env_conf=env_conf
logging.basicConfig(
handlers=[logging.StreamHandler()],
handlers=[log_handler],
level=log_config.level,
datefmt=log_config.time_format,
format='%(asctime)s %(message)s')