Completely refactored gresource to correspond SOLID principles

- Create logger interface and updated its usage by console.py
This commit is contained in:
Vladyslav Hroshev
2025-04-06 17:02:49 +03:00
parent 8da9b564be
commit 9bb229df7d
17 changed files with 316 additions and 182 deletions

View File

@@ -0,0 +1,36 @@
from abc import ABC, abstractmethod
from typing import Optional
class LoggerFactory(ABC):
@staticmethod
@abstractmethod
def create_logger(name: Optional[str] = None) -> 'Logger':
"""
Create a logger instance with the given name.
:param name: Name of the logger.
:return: Logger instance.
"""
pass
class Logger(ABC):
@abstractmethod
def update(self, message: str):
pass
@abstractmethod
def success(self, message):
pass
@abstractmethod
def error(self, message):
pass
@abstractmethod
def warn(self, message):
pass
@abstractmethod
def info(self, message):
pass