logger refactor

This commit is contained in:
Jakub Miazek
2023-06-03 15:34:31 +02:00
parent 03127a45ef
commit fce74a0016
7 changed files with 7 additions and 7 deletions

22
app/utils/logging.py Normal file
View File

@@ -0,0 +1,22 @@
import logging
from rich.console import Console
from rich.logging import RichHandler
from app.utils.singleton import SingletonMeta
class AppLogger(metaclass=SingletonMeta):
_logger = None
def __init__(self):
self._logger = logging.getLogger(__name__)
def get_logger(self):
return self._logger
class RichConsoleHandler(RichHandler):
def __init__(self, width=200, style=None, **kwargs):
super().__init__(console=Console(color_system="256", width=width, style=style), **kwargs)