mirror of
https://github.com/imarkoff/Marble-shell-theme.git
synced 2025-09-17 16:57:56 -07:00
Completely refactored gresource to correspond SOLID principles
- Create logger interface and updated its usage by console.py
This commit is contained in:
36
scripts/utils/logger/logger.py
Normal file
36
scripts/utils/logger/logger.py
Normal 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
|
Reference in New Issue
Block a user