Exemplo n.º 1
0
 def log_exception(self, exception, error=None):
     log_record = LogRecord(self._run, LogRecord.CATEGORY_SYSTEM,
                            logging.ERROR, str(exception))
     if error is not None:
         log_record.error = error
     else:
         log_record.error = traceback.format_exc()
     log.error(unicode(exception))
     self._log(log_record)