Browse Source

add error trace in email fetcher

Bastien Sevajol 7 years ago
parent
commit
8fcccaacd8
2 changed files with 4 additions and 4 deletions
  1. 2 2
      tracim/tracim/lib/base.py
  2. 2 2
      tracim/tracim/lib/email_fetcher.py

+ 2 - 2
tracim/tracim/lib/base.py View File

125
     def debug(self, instance_or_class, message):
125
     def debug(self, instance_or_class, message):
126
         self._logger.debug(Logger.TPL.format(cls=self._txt(instance_or_class), msg=message))
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
     def info(self, instance_or_class, message):
131
     def info(self, instance_or_class, message):
132
         self._logger.info(Logger.TPL.format(cls=self._txt(instance_or_class), msg=message))
132
         self._logger.info(Logger.TPL.format(cls=self._txt(instance_or_class), msg=message))

+ 2 - 2
tracim/tracim/lib/email_fetcher.py View File

245
             ))
245
             ))
246
             self._connection.login(self.user, self.password)
246
             self._connection.login(self.user, self.password)
247
         except Exception as e:
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
     def _disconnect(self) -> None:
251
     def _disconnect(self) -> None:
252
         if self._connection:
252
         if self._connection: