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)
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)
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)