add I2nLogger.exception
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Wed, 29 Jun 2016 15:04:02 +0000 (17:04 +0200)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Wed, 29 Jun 2016 15:04:02 +0000 (17:04 +0200)
src/log_helpers.py

index 1cbd2cf..5c16227 100644 (file)
@@ -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)