Replace custom logger
This commit is contained in:
parent
29827e40e1
commit
7ffcffc851
1 changed files with 2 additions and 18 deletions
|
@ -1,21 +1,5 @@
|
|||
import logging
|
||||
import threading
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class Logger:
|
||||
@staticmethod
|
||||
def _format(message: str, severity: str) -> str:
|
||||
thread = threading.current_thread().name
|
||||
datestr = str(datetime.now())
|
||||
return f"{datestr} - {thread} - {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"))
|
||||
class Logger(logging.Logger):
|
||||
name = "ReportMonster"
|
||||
|
|
Loading…
Reference in a new issue