瀏覽代碼

add error trace in email fetcher

Bastien Sevajol 7 年之前
父節點
當前提交
8fcccaacd8
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 2 2
      tracim/tracim/lib/base.py
  2. 2 2
      tracim/tracim/lib/email_fetcher.py

+ 2 - 2
tracim/tracim/lib/base.py 查看文件

@@ -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 查看文件

@@ -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: