diff sat/core/log_config.py @ 2836:ad00f61fd9f5

core (log): add traceback when "exc_info" is set
author Goffi <goffi@goffi.org>
date Sun, 03 Mar 2019 12:04:55 +0100
parents 003b8b4b56a7
children ab2696e34d29
line wrap: on
line diff
--- a/sat/core/log_config.py	Sun Mar 03 08:57:36 2019 +0100
+++ b/sat/core/log_config.py	Sun Mar 03 12:04:55 2019 +0100
@@ -34,11 +34,13 @@
 
         self.twisted_log = twisted_log
 
-    def out(self, message, level=None):
+    def out(self, message, level=None, **kwargs):
         """Actually log the message
 
         @param message: formatted message
         """
+        if kwargs.get('exc_info', False):
+            message = self.addTraceback(message)
         self.twisted_log.msg(
             message.encode("utf-8", "ignore"), sat_logged=True, level=level
         )