Added logger and improved service provider
This commit is contained in:
25
src/sh_edraft/logging/base/__init__.py
Normal file
25
src/sh_edraft/logging/base/__init__.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
sh_edraft.logging.base
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
|
||||
:copyright: (c) 2020 sh-edraft.de
|
||||
:license: MIT, see LICENSE for more details.
|
||||
|
||||
"""
|
||||
|
||||
__title__ = 'sh_edraft.logging.base'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 sh-edraft.de'
|
||||
__version__ = '2020.12.0.1'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major=2020, minor=12, micro=0.1)
|
31
src/sh_edraft/logging/base/logger_base.py
Normal file
31
src/sh_edraft/logging/base/logger_base.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from abc import abstractmethod
|
||||
|
||||
from sh_edraft.service.base import ServiceBase
|
||||
|
||||
|
||||
class LoggerBase(ServiceBase):
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self):
|
||||
ServiceBase.__init__(self)
|
||||
|
||||
@abstractmethod
|
||||
def header(self, string: str): pass
|
||||
|
||||
@abstractmethod
|
||||
def trace(self, name: str, message: str): pass
|
||||
|
||||
@abstractmethod
|
||||
def debug(self, name: str, message: str): pass
|
||||
|
||||
@abstractmethod
|
||||
def info(self, name: str, message: str): pass
|
||||
|
||||
@abstractmethod
|
||||
def warn(self, name: str, message: str): pass
|
||||
|
||||
@abstractmethod
|
||||
def error(self, name: str, message: str, ex: Exception = None): pass
|
||||
|
||||
@abstractmethod
|
||||
def fatal(self, name: str, message: str, ex: Exception = None): pass
|
Reference in New Issue
Block a user