Source code for pyzeta.framework.pyzeta_logging.logger_facade
"""
Class PyZetaLogger from the package pyzeta_logging.
This module provides a facade for `logging.Logger` class from the standard
library `logging` module. Any access to loggers in this project should happen
only through this interface.
Authors:\n
- Philipp Schuette\n
"""
from typing import Protocol, Union
[docs]
class PyZetaLogger(Protocol):
"The logging interface used throughout the PyZeta project."
[docs]
def debug(self, msg: str, *args: Union[str, int, float]) -> None:
"""
Log `msg` with severity DEBUG.
:param msg: Message to log
"""
...
[docs]
def info(self, msg: str, *args: Union[str, int, float]) -> None:
"""
Log `msg` with severity INFO.
:param msg: Message to log
"""
...
[docs]
def warning(self, msg: str, *args: Union[str, int, float]) -> None:
"""
Log `msg` with severity WARNING.
:param msg: Message to log
"""
...
[docs]
def error(self, msg: str, *args: Union[str, int, float]) -> None:
"""
Log `msg` with severity ERROR.
:param msg: Message to log
"""
...
[docs]
def critical(self, msg: str, *args: Union[str, int, float]) -> None:
"""
Log `msg` with severity CRITICAL.
:param msg: Message to log
"""
...
[docs]
def setLevel(self, level: int) -> None:
"""
Set the logging level to `level`
:param level: New level of the logger
"""
...
[docs]
def isEnabledFor(self, level: int) -> bool:
"""
Test if logging is enabled for level `level`.
:param level: Level to test
:return: If logging is enabled for level `level`
"""
...