mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-22 01:16:14 +00:00
print exc_info only on debug
This commit is contained in:
committed by
Florian BEZANNIER
parent
89e60083d4
commit
8209af5726
+7
-2
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user