示例#1
0
 def emit_exception(self, exc):
     self.log.exception(exc)
     return Event.save(self.crawler,
                       self.stage,
                       Event.LEVEL_ERROR,
                       self.run_id,
                       error=exc.__class__.__name__,
                       message=str(exc))
示例#2
0
 def emit_exception(self, exc):
     self.log.exception(exc)
     return Event.save(self.crawler.name,
                       self.operation_id,
                       Event.LEVEL_ERROR,
                       error_type=exc.__class__.__name__,
                       error_message=unicode(exc),
                       error_details=traceback.format_exc())
示例#3
0
 def emit_exception(self, exc):
     self.log.exception(exc)
     return Event.save(self.crawler.name,
                       self.stage.name,
                       Event.LEVEL_ERROR,
                       self.run_id,
                       error_type=exc.__class__.__name__,
                       error_message=six.text_type(exc),
                       error_details=traceback.format_exc())
示例#4
0
 def emit_warning(self, message, type=None, *args):
     if len(args):
         message = message % args
     self.log.warning(message)
     return Event.save(self.crawler,
                       self.stage,
                       Event.LEVEL_WARNING,
                       self.run_id,
                       error=type,
                       message=message)
示例#5
0
 def emit_warning(self, message, type=None, details=None, *args):
     if len(args):
         message = message % args
     self.log.warning(message)
     return Event.save(self.crawler.name,
                       self.operation_id,
                       Event.LEVEL_WARNING,
                       error_type=type,
                       error_message=message,
                       error_details=details)