feat: logging init

This commit is contained in:
superobk
2024-05-17 15:45:40 +08:00
parent 2ae5d361f0
commit 32b3f5e723
3 changed files with 10 additions and 8 deletions

View File

@ -6,10 +6,10 @@ from src.configuration import EnvConf, LogConf, singleton
@singleton
class Main():
env_conf: EnvConf
@inject
def __init__(self, log_config: LogConf, env_conf: EnvConf) -> None:
self.env_conf=env_conf
def __init__(self, logConf: LogConf) -> None:
logging.basicConfig(level=logConf.level,filename=logConf.filename,format="%(asctime)s %(levelname)s %(message)s")
def run(self):
logger = logging.getLogger(__name__)