Skip to content

Commit

Permalink
refactor(log): more object-oriented
Browse files Browse the repository at this point in the history
  • Loading branch information
Pandaft committed Mar 16, 2023
1 parent d09ba96 commit 5b74fde
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions esurfingpy/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,27 @@

class Logger(logging.Logger):

def __init__(self, name: str):
super().__init__(name)
self.log = logging.getLogger(name)
def __new__(cls, name):
return logging.getLogger(name)

def debug(self, msg: object, *args, **kwargs) -> object:
self.log.debug(msg, *args, **kwargs)
super().debug(msg, *args, **kwargs)
return msg

def info(self, msg: object, *args, **kwargs) -> object:
self.log.info(msg, *args, **kwargs)
super().info(msg, *args, **kwargs)
return msg

def warning(self, msg: object, *args, **kwargs) -> object:
self.log.warning(msg, *args, **kwargs)
super().warning(msg, *args, **kwargs)
return msg

def error(self, msg: object, *args, **kwargs) -> object:
self.log.error(msg, *args, **kwargs)
super().error(msg, *args, **kwargs)
return msg

def critical(self, msg: object, *args, **kwargs) -> object:
self.log.critical(msg, *args, **kwargs)
super().critical(msg, *args, **kwargs)
return msg


Expand Down

0 comments on commit 5b74fde

Please sign in to comment.