19 lines
612 B
Python
19 lines
612 B
Python
|
from datetime import datetime
|
||
|
|
||
|
class Logger:
|
||
|
@staticmethod
|
||
|
def _format(message: str, severity: str) -> str:
|
||
|
datestr = str(datetime.now())
|
||
|
return f"{datestr} - {severity} - {message}"
|
||
|
|
||
|
def debug(self, message: str) -> None:
|
||
|
print(self.__class__()._format(message, "DEBUG"))
|
||
|
|
||
|
def info(self, message: str) -> None:
|
||
|
print(self.__class__()._format(message, "INFO"))
|
||
|
|
||
|
def error(self, message: str) -> None:
|
||
|
print(self.__class__()._format(message, "ERROR"))
|
||
|
|
||
|
def fatal(self, message: str) -> None:
|
||
|
print(self.__class__()._format(message, "FATAL"))
|