From: Christian Herdtweck Date: Wed, 29 Jun 2016 15:04:02 +0000 (+0200) Subject: add I2nLogger.exception X-Git-Tag: v1.2~27 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=998ae6d70925efab4a155d7bbf6bf8bf36c57277;p=pyi2ncommon add I2nLogger.exception --- diff --git a/src/log_helpers.py b/src/log_helpers.py index 1cbd2cf..5c16227 100644 --- a/src/log_helpers.py +++ b/src/log_helpers.py @@ -281,6 +281,12 @@ class I2nLogger: def error(self, message, *args, **kwargs): self._log_no_test(ERROR, message, *args, **kwargs) + def exception(self, message, *args, **kwargs): + if 'exc_info' in kwargs: + self._log_no_test(ERROR, message, *args, **kwargs) + else: + self._log_no_test(ERROR, message, *args, exc_info=True, **kwargs) + def critical(self, message, *args, **kwargs): self._log_no_test(CRITICAL, message, *args, **kwargs)