mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-14 09:03:25 +00:00
tmp
This commit is contained in:
15
src/log/log.py
Normal file
15
src/log/log.py
Normal file
@ -0,0 +1,15 @@
|
||||
import logging
|
||||
from injector import singleton, inject
|
||||
|
||||
from ..configuration import LogConf
|
||||
|
||||
@singleton
|
||||
class Logger(logging.Logger):
|
||||
|
||||
@inject
|
||||
def __init__(self, config: LogConf) -> None:
|
||||
super().__init__(__name__)
|
||||
self.setLevel(config.level)
|
||||
self.addHandler(logging.StreamHandler())
|
||||
self.addHandler(logging.FileHandler('log.log'))
|
||||
|
||||
Reference in New Issue
Block a user