Publish a log record to the logging pane.

@param record
Log record
@throws Exception
489040
protected synchronized void publish(LogRecord record) throws BadLocationException {
    // choose an appropriate formatter
    final Formatter fmt;
    final Style style;
    // always format progress messages using the progress formatter.
    if(record.getLevel().intValue() >= Level.WARNING.intValue()) {
      // format errors using the error formatter
      fmt = errformat;
      style = errStyle;
    }
    else if(record.getLevel().intValue() <= Level.FINE.intValue()) {
      // format debug statements using the debug formatter.
      fmt = debugformat;
      style = dbgStyle;
    }
    else {
      // default to the message formatter.
      fmt = msgformat;
      style = msgStyle;
    }
    // format
    final String m;
    m = fmt.format(record);
    StyledDocument doc = getStyledDocument();
    if(record instanceof ProgressLogRecord) {
      if(lastNewlinePos < doc.getLength()) {
        doc.remove(lastNewlinePos, doc.getLength() - lastNewlinePos);
      }
    }
    else {
      // insert a newline, if we didn't see one yet.
      if(lastNewlinePos < doc.getLength()) {
        doc.insertString(doc.getLength(), "\n", style);
        lastNewlinePos = doc.getLength();
      }
    }
    int tail = tailingNonNewline(m, 0, m.length());
    int headlen = m.length() - tail;
    if(headlen > 0) {
      String pre = m.substring(0, headlen);
      doc.insertString(doc.getLength(), pre, style);
    }
    lastNewlinePos = doc.getLength();
    if(tail > 0) {
      String post = m.substring(m.length() - tail);
      doc.insertString(lastNewlinePos, post, style);
    }
  }
717768
public void fixRecord(Record record)
    {
        super.fixRecord(record);
        if (this.getProperty("field") != null)
        {
            BaseField field = this.getMainRecord().getField(this.getProperty("field").toString());
            if (field != null)
                this.fixCapitalization(field);
        }
    }
531938
async def emit(self, record: LogRecord):  # type: ignore
        
        if self.writer is None:
            self.writer = await self._init_writer()

        try:
            msg = self.format(record) + self.terminator

            self.writer.write(msg.encode())
            await self.writer.drain()
        except Exception:
            await self.handleError(record)
196875
async def emit(self, record: LogRecord):  # type: ignore
        
        try:
            if self.should_rollover(record):
                async with self._rollover_lock:
                    if self.should_rollover(record):
                        await self.do_rollover()
            await super().emit(record)
        except Exception as e:
            await self.handleError(record)
1098789
private ApacheHttpRequest<GenericRecord> buildWriteRequest(BufferedRecord<GenericRecord> record) {
    if (record == null) {
      return null;
    }

    ApacheHttpRequest<GenericRecord> request = new ApacheHttpRequest<>();
    HttpOperation httpOperation = HttpUtils.toHttpOperation(record.getRecord());

    // Set uri
    URI uri = HttpUtils.buildURI(urlTemplate, httpOperation.getKeys(), httpOperation.getQueryParams());
    if (uri == null) {
      return null;
    }

    RequestBuilder builder = RequestBuilder.create(verb.toUpperCase());
    builder.setUri(uri);

    // Set headers
    Map<String, String> headers = httpOperation.getHeaders();
    if (headers != null && headers.size() != 0) {
      for (Map.Entry<String, String> header : headers.entrySet()) {
        builder.setHeader(header.getKey(), header.getValue());
      }
    }

    // Add payload
    int bytesWritten = addPayload(builder, httpOperation.getBody());
    if (bytesWritten == -1) {
      throw new RuntimeException("Fail to write payload into request");
    }

    request.setRawRequest(build(builder));
    request.markRecord(record, bytesWritten);
    return request;
  }
521201
public void logError(String message, Exception exception) {
        if (!(logError || globalLog.logError))
            return;
	
        if (errorLog != null)
            log(errorLog, "ERROR", owner, message, exception);
        else 
            log(globalLog.errorLog, "ERROR", owner, message, exception);
    }
733931
def emit(self, record):
		
		failures = 0
		while failures < 3:
			try:
				self.stream_emit(record, record.name)
				break
			except:
				failures += 1
		else:
			traceback.print_stack()
			print("Error writing to file?")


		self.close()
763057
@Override
  public void write(byte[] record) throws IOException {
    Preconditions.checkNotNull(record);

    byte[] toWrite = record;
    if (this.recordDelimiter.isPresent()) {
      toWrite = Arrays.copyOf(record, record.length + 1);
      toWrite[toWrite.length - 1] = this.recordDelimiter.get();
    }
    if (this.prependSize) {
      long recordSize = toWrite.length;
      ByteBuffer buf = ByteBuffer.allocate(Longs.BYTES);
      buf.putLong(recordSize);
      toWrite = ArrayUtils.addAll(buf.array(), toWrite);
    }
    this.stagingFileOutputStream.write(toWrite);
    this.bytesWritten += toWrite.length;
    this.recordsWritten++;
  }
944307
public void writeRecord(byte[] record) throws IOException {
        if (this.debug) {
            System.err.println("WriteRecord: recIdx = " + this.currRecIdx + " blkIdx = " + this.currBlkIdx);
        }

        if (this.outStream == null) {
            throw new IOException("writing to an input buffer");
        }

        if (record.length != this.recordSize) {
            throw new IOException("record to write has length '" + record.length
                + "' which is not the record size of '" + this.recordSize + "'");
        }

        if (this.currRecIdx >= this.recsPerBlock) {
            this.writeBlock();
        }

        System.arraycopy(record, 0, this.blockBuffer, (this.currRecIdx * this.recordSize), this.recordSize);

        this.currRecIdx++;
    }
1022801
protected boolean writeNextRecord(T record) throws IOException {
		try {
			this.serializer.serialize(record, this.collectingView);
			this.numRecordsInBuffer++;
			return true;
		} catch (EOFException eofex) {
			return false;
		}
	}
1130456
public synchronized void writeRecord(String record) {
        long length = record.length() + nlen;
        PrintStream ps = getPrintStream(length, null);
        ps.println(record);
    }
807189
public void addListener(Record record, FileListener listener)
    {
        if (this.getNextTable() != null)
            this.getNextTable().addListener(record, listener);
    }
750818
public int insert(Entity record) throws SQLException {
		Connection conn = null;
		try {
			conn = this.getConnection();
			return runner.insert(conn, record);
		} catch (SQLException e) {
			throw e;
		} finally {
			this.closeConnection(conn);
		}
	}
784159
public void logDebug(String message, Exception exception) {
        if (!(logDebug || globalLog.logDebug))
            return;

        if (debugLog != null)
            log(debugLog, "DEBUG", owner, message, exception);
        else 
            log(globalLog.debugLog, "DEBUG", owner, message, exception);
    }
727567
def emit(self, record):
        
        try:
            if self.shouldRollover(record):
                self.doRollover()
            FileHandler.emit(self, record)
        except (KeyboardInterrupt, SystemExit):
            raise
        except Exception:
            self.handleError(record)
1287488
public void doSet(Rec record) throws DBException
    {
        try   {
            m_objLastModBookmark = null;
            m_tableRemote.set(this.getDataSource(), record.getOpenMode());
        } catch (RemoteException ex) {
            throw new DBException(ex.getMessage());
        }
    }
1268512
def emit(self, record):
        """"""
        try:
            self._callback(self.prepare(record))
        except Exception:
            self.handleError(record)