Beispiel #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)
Beispiel #2
0
    def log_invalid_countrytime(self, data):
        log_record = LogRecord(self._run, LogRecord.CATEGORY_DATA,
                               logging.ERROR, "could not find the country " + str(data['label']))
        log_record.attribute = "Country"
        log_record.column = "Country"
        log_record.value = str(data['label'])
        log_record.data_type = "Country"

        db.session.add(log_record)
        db.session.commit()

        print "Could not find country", str(data['label'])
Beispiel #3
0
    def log_invalid_data(self, invalid):
        log_record = LogRecord(self._run, LogRecord.CATEGORY_DATA,
                               logging.ERROR, invalid.msg)
        log_record.attribute = invalid.node.name
        log_record.column = invalid.column
        log_record.value = invalid.value
        log_record.data_type = invalid.datatype

        msg = "'%s' (%s) could not be generated from column '%s'" \
              " (value: %s): %s"
        msg = msg % (invalid.node.name, invalid.datatype,
                     invalid.column, invalid.value, invalid.msg)
        log.warn(msg)
        self._log(log_record)