wip: temp

This commit is contained in:
superobk
2024-05-16 16:02:13 +08:00
parent e4136ee4e3
commit 0612c065c0
4 changed files with 10 additions and 10 deletions

View File

@ -7,18 +7,19 @@ 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=[log_handler],
handlers=[logging.StreamHandler()],
level=log_config.level,
datefmt=log_config.time_format,
format='%(asctime)s %(message)s')
def run(self):
logger = logging.getLogger(__name__)
logger.info("jarvis-models start", "version", "0.0.1")
logger.info("jarvis-models start", extra={"version": "0.0.1"})
uvicorn.run("server:app", host="0.0.0.0", port=8000, log_level="info")
if __name__ == "__main__":