feat(shared): remove unused abstract app (#1828)
This commit is contained in:
parent
3a2e910f12
commit
515a975e51
2 changed files with 0 additions and 61 deletions
|
@ -1,39 +0,0 @@
|
|||
from abc import ABC, abstractmethod
|
||||
from os import PathLike
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from loguru import logger
|
||||
|
||||
from .logging import LogLevel, level_from_name, setup_logger
|
||||
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
class AbstractApp(ABC):
|
||||
"""
|
||||
Abstracts the creation of an application to reduce boilerplate code such
|
||||
as logging setup.
|
||||
"""
|
||||
|
||||
log_level: LogLevel
|
||||
log_filepath: Optional[Path] = None
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def name(self) -> str:
|
||||
...
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
log_level: str,
|
||||
log_filepath: Optional[PathLike] = None,
|
||||
):
|
||||
self.log_level = level_from_name(log_level)
|
||||
|
||||
if log_filepath is not None:
|
||||
self.log_filepath = Path(log_filepath)
|
||||
|
||||
setup_logger(level=self.log_level, filepath=self.log_filepath)
|
||||
|
||||
logger.info(f"Starting {self.name}...")
|
Loading…
Add table
Add a link
Reference in a new issue