mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-13 16:53:24 +00:00
feat: logging init
This commit is contained in:
@ -69,7 +69,7 @@ DEFAULT_TIME_FORMAT="%Y-%m-%d %H:%M:%S"
|
||||
class LogConf():
|
||||
level: int
|
||||
time_format = "%Y-%m-%d %H:%M:%S"
|
||||
|
||||
filename: str | None
|
||||
@inject
|
||||
def __init__(self,config: Configuration) -> None:
|
||||
self.level = config.get("log.level")
|
||||
@ -79,12 +79,13 @@ class LogConf():
|
||||
self.level = logging.WARNING
|
||||
else:
|
||||
self.level = level
|
||||
self.time_format=config.get("log.time_format", default=DEFAULT_TIME_FORMAT)
|
||||
self.filename = config.get("log.filename")
|
||||
self.time_format = config.get("log.time_format", default=DEFAULT_TIME_FORMAT)
|
||||
|
||||
@singleton
|
||||
class EnvConf():
|
||||
version: str
|
||||
|
||||
@inject
|
||||
def __init__(self, config: Configuration) -> None:
|
||||
self.version = config.get("env.version")
|
||||
def __init__(self) -> None:
|
||||
self.version = "0.0.1"
|
||||
|
||||
Reference in New Issue
Block a user