From 998ae6d70925efab4a155d7bbf6bf8bf36c57277 Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Wed, 29 Jun 2016 17:04:02 +0200 Subject: [PATCH] add I2nLogger.exception --- src/log_helpers.py | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) 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) -- 1.7.1