示例#1
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'])
示例#2
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)