Quellcode durchsuchen

add error trace in email fetcher

Bastien Sevajol vor 7 Jahren
Ursprung
Commit
8fcccaacd8
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 2 2
      tracim/tracim/lib/base.py
  2. 2 2
      tracim/tracim/lib/email_fetcher.py

+ 2 - 2
tracim/tracim/lib/base.py Datei anzeigen

@@ -125,8 +125,8 @@ class Logger(object):
125 125
     def debug(self, instance_or_class, message):
126 126
         self._logger.debug(Logger.TPL.format(cls=self._txt(instance_or_class), msg=message))
127 127
 
128
-    def error(self, instance_or_class, message):
129
-        self._logger.error(Logger.TPL.format(cls=self._txt(instance_or_class), msg=message))
128
+    def error(self, instance_or_class, message, exc_info=0):
129
+        self._logger.error(Logger.TPL.format(cls=self._txt(instance_or_class), msg=message, exc_info=exc_info))
130 130
 
131 131
     def info(self, instance_or_class, message):
132 132
         self._logger.info(Logger.TPL.format(cls=self._txt(instance_or_class), msg=message))

+ 2 - 2
tracim/tracim/lib/email_fetcher.py Datei anzeigen

@@ -245,8 +245,8 @@ class MailFetcher(object):
245 245
             ))
246 246
             self._connection.login(self.user, self.password)
247 247
         except Exception as e:
248
-            log = 'IMAP login error: {}'
249
-            logger.error(self, log.format(e.__str__()))
248
+            log = 'Error during execution: {}'
249
+            logger.error(self, log.format(e.__str__()), exc_info=1)
250 250
 
251 251
     def _disconnect(self) -> None:
252 252
         if self._connection: