mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-14 09:03:25 +00:00
feat: log
This commit is contained in:
@ -7,7 +7,4 @@ class LogHandler(logging.StreamHandler):
|
||||
|
||||
def emit(self, record) -> None:
|
||||
print("emit", record)
|
||||
|
||||
def handle(self, record) -> None:
|
||||
print("@ handle",record)
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
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