Make params
arg for logging functions optional
This commit is contained in:
parent
5299f816af
commit
2ca4fd48f7
3 changed files with 11 additions and 11 deletions
|
@ -38,7 +38,7 @@ class Module(ModuleManager.BaseModule):
|
||||||
|
|
||||||
if event["args"][0] == "SUCCESS":
|
if event["args"][0] == "SUCCESS":
|
||||||
resume_channels = event["server"].get_setting("resume-channels", [])
|
resume_channels = event["server"].get_setting("resume-channels", [])
|
||||||
self.log.info("Successfully resumed session", [])
|
self.log.info("Successfully resumed session")
|
||||||
event["server"].cap_started = False
|
event["server"].cap_started = False
|
||||||
|
|
||||||
elif event["args"][0] == "TOKEN":
|
elif event["args"][0] == "TOKEN":
|
||||||
|
|
|
@ -47,12 +47,12 @@ class Module(ModuleManager.BaseModule):
|
||||||
self._reload_modules()
|
self._reload_modules()
|
||||||
|
|
||||||
def _reload_config(self):
|
def _reload_config(self):
|
||||||
self.bot.log.info("Reloading config file", [])
|
self.bot.log.info("Reloading config file")
|
||||||
self.bot.config.load()
|
self.bot.config.load()
|
||||||
self.bot.log.info("Reloaded config file", [])
|
self.bot.log.info("Reloaded config file")
|
||||||
|
|
||||||
def _reload_modules(self):
|
def _reload_modules(self):
|
||||||
self.bot.log.info("Reloading modules", [])
|
self.bot.log.info("Reloading modules")
|
||||||
|
|
||||||
success = []
|
success = []
|
||||||
fail = []
|
fail = []
|
||||||
|
|
|
@ -49,17 +49,17 @@ class Log(object):
|
||||||
warn_handler.setFormatter(formatter)
|
warn_handler.setFormatter(formatter)
|
||||||
self.logger.addHandler(warn_handler)
|
self.logger.addHandler(warn_handler)
|
||||||
|
|
||||||
def trace(self, message: str, params: typing.List, **kwargs):
|
def trace(self, message: str, params: typing.List=None, **kwargs):
|
||||||
self._log(message, params, LEVELS["trace"], kwargs)
|
self._log(message, params, LEVELS["trace"], kwargs)
|
||||||
def debug(self, message: str, params: typing.List, **kwargs):
|
def debug(self, message: str, params: typing.List=None, **kwargs):
|
||||||
self._log(message, params, logging.DEBUG, kwargs)
|
self._log(message, params, logging.DEBUG, kwargs)
|
||||||
def info(self, message: str, params: typing.List, **kwargs):
|
def info(self, message: str, params: typing.List=None, **kwargs):
|
||||||
self._log(message, params, logging.INFO, kwargs)
|
self._log(message, params, logging.INFO, kwargs)
|
||||||
def warn(self, message: str, params: typing.List, **kwargs):
|
def warn(self, message: str, params: typing.List=None, **kwargs):
|
||||||
self._log(message, params, logging.WARN, kwargs)
|
self._log(message, params, logging.WARN, kwargs)
|
||||||
def error(self, message: str, params: typing.List, **kwargs):
|
def error(self, message: str, params: typing.List=None, **kwargs):
|
||||||
self._log(message, params, logging.ERROR, kwargs)
|
self._log(message, params, logging.ERROR, kwargs)
|
||||||
def critical(self, message: str, params: typing.List, **kwargs):
|
def critical(self, message: str, params: typing.List=None, **kwargs):
|
||||||
self._log(message, params, logging.CRITICAL, kwargs)
|
self._log(message, params, logging.CRITICAL, kwargs)
|
||||||
def _log(self, message: str, params: typing.List, level: int, kwargs: dict):
|
def _log(self, message: str, params: typing.List, level: int, kwargs: dict):
|
||||||
self.logger.log(level, message, *params, **kwargs)
|
self.logger.log(level, message, *(params or []), **kwargs)
|
||||||
|
|
Loading…
Reference in a new issue