diff --git a/mylogger.py b/mylogger.py index 3fba1ff..5a957d8 100644 --- a/mylogger.py +++ b/mylogger.py @@ -6,12 +6,17 @@ logging.addLevelName(DEBUG_LEVELV_NUM, "DEBUGV") class CustomLogger(logging.Logger): - # pylint: disable=too-many-arguments + # pylint: disable=too-many-arguments,unused-argument,arguments-differ + def _log(self, level, msg, args, exc_info=None, extra=None, stack_info=False, exc_info_debug=False, **kwargs): + if exc_info_debug and self.isEnabledFor(logging.DEBUG): + exc_info = True + super()._log(level, msg, args, exc_info, extra, stack_info) + def __new_style_log(self, level, msg, args, exc_info=None, extra=None, stack_info=False, **kwargs): if kwargs.pop('style', "%") == "{": # optional msg = msg.format(*args) args = [] - super()._log(level, msg, args, exc_info, extra, stack_info) + self._log(level, msg, args, exc_info, extra, stack_info) def debugv(self, msg, *args, **kwargs): if self.isEnabledFor(DEBUG_LEVELV_NUM):