From 76c3ade3941b3206a2f81d264c2ca881890c4cf3 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Fri, 11 Dec 2020 17:03:18 +0100 Subject: [PATCH] Changed logging in worker thread --- cps/services/worker.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cps/services/worker.py b/cps/services/worker.py index ad7de62e..d3b7b14f 100644 --- a/cps/services/worker.py +++ b/cps/services/worker.py @@ -161,7 +161,8 @@ class CalibreTask: self.run(*args) except Exception as e: self._handleError(str(e)) - log.exception(e) + if logger.is_debug_enabled(): + log.exception(e) self.end_time = datetime.now() @@ -210,10 +211,7 @@ class CalibreTask: self._progress = x def _handleError(self, error_message): - if logger.is_debug_enabled(): - log.exception(error_message) - else: - log.error(error_message) + log.error(error_message) self.stat = STAT_FAIL self.progress = 1 self.error = error_message