logging services

This commit is contained in:
Adam Wilson
2025-05-30 12:03:11 -06:00
parent e2f552a1c5
commit 19910c4e53
10 changed files with 24 additions and 14 deletions
@@ -0,0 +1,10 @@
import abc
import logging
class AbstractLoggingService(abc.ABC):
def __init__(self, handler: logging.Handler):
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
logger.addHandler(handler)
self.logger = logger
@@ -0,0 +1,8 @@
import logging
from src.text_generation.services.logging.abstract_logging_service import AbstractLoggingService
class FileLoggingService(AbstractLoggingService):
def __init__(self, filename):
super().__init__(handler=logging.FileHandler(filename))
self.logger = super().logger