Persist a record into the database

        Args:
            record (`logging.Record`): The logging.Record object to store

        Returns:
            `None`
355297
def emit(self, record):
        
        # Skip records less than min_level
        if record.levelno < logging.getLevelName(self.min_level):
            return

        evt = LogEvent()
        evt.level = record.levelname
        evt.levelno = record.levelno
        evt.timestamp = datetime.fromtimestamp(record.created)
        evt.message = record.message
        evt.filename = record.filename
        evt.lineno = record.lineno
        evt.module = record.module
        evt.funcname = record.funcName
        evt.pathname = record.pathname
        evt.process_id = record.process

        # Only log stacktraces if its the level is ERROR or higher
        if record.levelno >= 40:
            evt.stacktrace = traceback.format_exc()

        try:
            db.session.add(evt)
            db.session.commit()
        except Exception:
            db.session.rollback()
668688
def setCurrentRecord( self, record ):
        
        mode = self.currentMode()
        if ( mode == XOrbBrowserWidget.Mode.Detail ):
            self.detailWidget().setCurrentRecord(record)
        
        elif ( mode == XOrbBrowserWidget.Mode.Thumbnail ):
            thumbs = self.thumbnailWidget()
            for row in range(thumbs.count()):
                item = thumbs.item(row)
                if ( isinstance(item, RecordListWidgetItem) and \
                     item.record() == item ):
                    thumbs.setCurrentItem(item)
                    break
1282477
def save(self, fp, mode='wb'):
        
        if hasattr(fp, 'write'):
            self._record.write(fp)
        else:
            with open(fp, mode) as f:
                self._record.write(f)
862611
public void processEvent(LogRecord record) {
		byte[] bytes;

		SerializationObject serializationObject = pool.getSerializationObject();
		try {
			bytes = serializationObject.serialize(record);
		} finally {
			pool.returnSerializationObject(serializationObject);
		}

		synchronized(this) {
			if (traceWriter != null && record.getLevel().intValue() < traceThreshold) {
				traceWriter.logRecord(record.getMillis(), bytes);
			} else if (logWriter != null) {
				logWriter.logRecord(record.getMillis(), bytes);
			}
		}
	}
874789
def emit(self, record):
        
        try:
            # Shorten the source name of the record (remove rafcon.)
            if sys.version_info >= (2, 7):
                record.__setattr__("name", record.name.replace("rafcon.", ""))
            msg = self.format(record)
            fs = "%s"
            try:
                ufs = u'%s'
                try:
                    entry = ufs % msg
                except UnicodeEncodeError:
                    entry = fs % msg
            except UnicodeError:
                entry = fs % msg

            for logging_view in self._logging_views.values():
                logging_view.print_message(entry, record.levelno)
        except (KeyboardInterrupt, SystemExit):
            raise
        except:
            self.handleError(record)
966495
def handle(self, record):
        
        record = self.prepare(record)
        for handler in self.handlers:
            handler(record)
593803
def persist!(saved = false)
      @new_record, @uri = false
      if changed?
        @previous_changes = changes if saved
        changed_attributes.clear
      end
      true
    end
9442
def addRecord(self, record):
        
        if self._destroyed:
            return
        
        if not self.uiRecordBTN.isChecked():
            return
        
        self._queue.append(record)
880164
def store(self, record, value):
        """"""
        record._values[self.name][record.id] = value
1288121
def _create_record(self, rtype, name, content):
        """"""
        if not self._list_records(rtype, name, content):
            self._update_records([{}], {
                'type': rtype,
                'hostname': self._relative_name(name),
                'destination': content,
                'priority': self._get_lexicon_option('priority'),
            })
        LOGGER.debug('create_record: %s', True)
        return True
762406
def record(self):
        # type: () -> bytes
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('PN record not yet initialized!')

        return b'PN' + struct.pack('=BBLLLL', RRPNRecord.length(), SU_ENTRY_VERSION, self.dev_t_high, utils.swab_32bit(self.dev_t_high), self.dev_t_low, utils.swab_32bit(self.dev_t_low))
1243263
def setCurrentRecord(self, record, autoAdd=False):
        
        if record is not None and not Table.recordcheck(record):
            return False
        
        # don't reassign the current record
        # clear the record
        if record is None:
            self._currentRecord = None
            blocked = self.signalsBlocked()
            self.blockSignals(True)
            self.setCurrentIndex(-1)
            self.blockSignals(blocked)
            
            if not blocked:
                self.currentRecordChanged.emit(None)
            
            return True
        
        elif record == self.currentRecord():
            return False
        
        self._currentRecord = record
        found = False
        
        blocked = self.signalsBlocked()
        self.blockSignals(True)
        for i in range(self.count()):
            stored = unwrapVariant(self.itemData(i, Qt.UserRole))
            if stored == record:
                self.setCurrentIndex(i)
                found = True
                break
        
        if not found and autoAdd:
            self.addRecord(record)
            self.setCurrentIndex(self.count() - 1)
        
        self.blockSignals(blocked)
        
        if not blocked:
            self.currentRecordChanged.emit(record)
        return False
816135
def record(self):
        # type: () -> bytes
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('NM record not yet initialized!')

        return b'NM' + struct.pack(b'=BBB', RRNMRecord.length(self.posix_name), SU_ENTRY_VERSION, self.posix_name_flags) + self.posix_name
969469
def _create_record(self, rtype, name, content):
        """"""
        found = self._list_records(rtype=rtype, name=name, content=content)
        if found:
            return True

        record = self._create_request_record(None, rtype, name, content,
                                             self._get_lexicon_option('ttl'),
                                             self._get_lexicon_option('priority'))

        self._request_add_dns_record(record)
        return True
535352
def record(self):
        # type: () -> bytes
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('RE record not yet initialized!')

        return b'RE' + struct.pack('=BB', RRRERecord.length(), SU_ENTRY_VERSION)
1373458
public void publish(LogRecord record)
  {
    if (! isLoggable(record))
      return;
    
    int level = getLevel().intValue();

    for (int i = 0; i < _handlers.length; i++) {
      Handler handler = _handlers[i];

      if (level <= handler.getLevel().intValue())
        handler.publish(record);
    }
  }
1116739
def record(self):
        # type: () -> bytes
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('PL record not yet initialized!')

        return b'PL' + struct.pack('=BBLL', RRPLRecord.length(), SU_ENTRY_VERSION, self.parent_log_block_num, utils.swab_32bit(self.parent_log_block_num))