Log a LogRecord.
<p>
All the other logging methods in this class call through
this method to actually perform any logging.  Subclasses can
override this single method to capture all log activity.

@param record the LogRecord to be published
777577
public void log(LogRecord record) {
        if (record.getLevel().intValue() < levelValue || levelValue == offValue) {
            return;
        }
        Filter theFilter = filter;
        if (theFilter != null && !theFilter.isLoggable(record)) {
            return;
        }

        // Post the LogRecord to all our Handlers, and then to
        // our parents' handlers, all the way up the tree.

        Logger logger = this;
        while (logger != null) {
            for (Handler handler : logger.getHandlers()) {
                handler.publish(record);
            }

            if (!logger.getUseParentHandlers()) {
                break;
            }

            logger = logger.getParent();
        }
    }
325274
private static void publish(Logger logger, LogRecord record) {
    // Annoyingly this method appears to copy the array every time it is called, but there's
    // nothing much we can do about this (and there could be synchronization issues even if we
    // could access things directly because handlers can be changed at any time). Most of the
    // time this returns the singleton empty array however, so it's not as bad as all that.
    for (Handler handler : logger.getHandlers()) {
      handler.publish(record);
    }
    if (logger.getUseParentHandlers()) {
      logger = logger.getParent();
      if (logger != null) {
        publish(logger, record);
      }
    }
  }
641514
@Override
    public void log(Level level, String msg) {
        if (isLoggable(level)) {
            LogRecord logRecord = createLogRecord(level, msg, null, null, null, null, null);
            log(logRecord);
        }
    }
1306464
public WriteResponse write (String record) throws IOException {
    recordsAttempted.mark();
    String encoded = encodeRecord(record);
    int returnCode = request (encoded);
    recordsSuccess.mark();
    bytesWritten.mark(encoded.length());
    return WRITE_RESPONSE_WRAPPER.wrap(returnCode);
  }
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);
    }
  }
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)
1271518
protected EventBuilder createEventBuilder(LogRecord record) {
        EventBuilder eventBuilder = new EventBuilder()
            .withSdkIntegration("java.util.logging")
            .withLevel(getLevel(record.getLevel()))
            .withTimestamp(new Date(record.getMillis()))
            .withLogger(record.getLoggerName());

        String message = record.getMessage();
        if (record.getResourceBundle() != null && record.getResourceBundle().containsKey(record.getMessage())) {
            message = record.getResourceBundle().getString(record.getMessage());
        }

        String topLevelMessage = message;
        if (record.getParameters() == null) {
            eventBuilder.withSentryInterface(new MessageInterface(message));
        } else {
            String formatted;
            List<String> parameters = formatMessageParameters(record.getParameters());
            try {
                formatted = formatMessage(message, record.getParameters());
                topLevelMessage = formatted; // write out formatted as Event's message key
            } catch (Exception e) {
                // local formatting failed, send message and parameters without formatted string
                formatted = null;
            }
            eventBuilder.withSentryInterface(new MessageInterface(message, parameters, formatted));
        }
        eventBuilder.withMessage(topLevelMessage);

        Throwable throwable = record.getThrown();
        if (throwable != null) {
            eventBuilder.withSentryInterface(new ExceptionInterface(throwable));
        }

        Map<String, String> mdc = MDC.getMDCAdapter().getCopyOfContextMap();
        if (mdc != null) {
            for (Map.Entry<String, String> mdcEntry : mdc.entrySet()) {
                if (Sentry.getStoredClient().getMdcTags().contains(mdcEntry.getKey())) {
                    eventBuilder.withTag(mdcEntry.getKey(), mdcEntry.getValue());
                } else {
                    eventBuilder.withExtra(mdcEntry.getKey(), mdcEntry.getValue());
                }
            }
        }

        eventBuilder.withExtra(THREAD_ID, record.getThreadID());

        return eventBuilder;
    }
416912
public void log(Level level, String message, Object... args) {
      if (logger.isLoggable(level)) {
         String errorMessage = "";
         Throwable thrown = null;
         Object[] params = null;

         if (args == null || args.length == 0) {
            errorMessage = message;
         } else if (args[0] instanceof Throwable) {
            thrown = (Throwable) args[0];
            if (args.length > 1) {
               params = new Object[args.length - 1];
               System.arraycopy(args, 1, params, 0, args.length - 1);
            }
         } else if (args[args.length - 1] instanceof Throwable) {
            params = new Object[args.length - 1];
            System.arraycopy(args, 0, params, 0, args.length - 1);
            thrown = (Throwable) args[args.length - 1];
         } else {
            params = new Object[args.length];
            System.arraycopy(args, 0, params, 0, args.length);
         }

         if (params != null) {
            errorMessage = MessageFormat.format(message, params);
         }

         LogRecord record = new LogRecord(level, errorMessage);
         record.setLoggerName(logger.getName());
         record.setThrown(thrown);
         record.setParameters(args);
         logger.log(record);
      }
   }
430355
public void setReferenceRecord(Record record)
    {
        if (m_recordReference != record)
        {
            if (m_recordReference != null)
            { // Take behaviors off old references
               // You only want to disconnect the referenced record (not free it).
                if (this.getRecord() != null)
                {
                    FreeOnFreeHandler freeListener = (FreeOnFreeHandler)this.getRecord().getListener(FreeOnFreeHandler.class);
                    while (freeListener != null)
                    {
                        if (freeListener.getDependentObject() == m_recordReference)
                        {
                            freeListener.setDependentObject(null);
                            this.getRecord().removeListener(freeListener, true);
                            break;
                        }
                        freeListener = (FreeOnFreeHandler)freeListener.getListener(FreeOnFreeHandler.class);
                    }
                }

                ClearFieldReferenceOnCloseHandler listener = (ClearFieldReferenceOnCloseHandler)m_recordReference.getListener(ClearFieldReferenceOnCloseHandler.class.getName());
                while (listener != null)
                {
                    if (listener.getField() == this)
                    {
                        Record recordTemp = m_recordReference;
                        m_recordReference = null; // Cancel echo
                        recordTemp.removeListener(listener, true);
                        listener = null;    // Got it!
                    }
                    else
                        listener = (ClearFieldReferenceOnCloseHandler)listener.getListener(ClearFieldReferenceOnCloseHandler.class.getName());
                }
            }
            if (record != null)
            { // Make sure reference is cleared when record is discarded
                record.addListener(new ClearFieldReferenceOnCloseHandler(this));
            }
            m_recordReference = record;
        }
    }
99229
public void log() {
    if (logger != null) {
      if (registry != null) {
        if (isClient()) {
          recordClientMetrics();
        } else {
          recordServerMetrics();
        }
      }
      if (inflightId != null) {
        logger.inflightRequests(inflightId).decrementAndGet();
      }

      logger.log(this);
    } else {
      reset();
    }
  }
1318985
protected String format(LogRecord record)
  {
    if (! isLoggable(record)) {
      return null;
    }
    
    StringBuilder sb = new StringBuilder();
    
    if (record == null) {
      sb.append("no record");
          
      if (isNullDelimited()) {
        sb.append('\0');
      }

      return sb.toString();
    }

    try {
      Formatter formatter = getFormatter();
      
      if (formatter != null) {
        String value = formatter.format(record);
  
        sb.append(value).append('\n');
        
        if (isNullDelimited()) {
          sb.append('\0');
        }
          
        return sb.toString();
      }
        
      String message = record.getMessage();
      Throwable thrown = record.getThrown();
        
      if (thrown == null
          && message != null
          && message.indexOf("java.lang.NullPointerException") >= 0) {
        thrown = new IllegalStateException();
        thrown.fillInStackTrace();
      }
            
      if (thrown != null) {
        if (message != null
            && ! message.equals(thrown.toString()) 
            && ! message.equals(thrown.getMessage())) {
          printMessage(sb, message, record.getParameters());
        }
          
        StringWriter writer = new StringWriter();
        PrintWriter pw = new PrintWriter(writer);
        thrown.printStackTrace(pw);
        pw.close();
        
        sb.append(writer.toString());
      }
      else {
        printMessage(sb, message, record.getParameters());
      }

      /*
      TimestampFilter timestamp = getTimestampFilter();
      if (timestamp != null) {
        sb = timestamp.format(sb);
      }
      */
        
      if (isNullDelimited()) {
        sb.append('\0');
      }
    } catch (Throwable e) {
      e.printStackTrace();
    }

    return sb.toString();
  }
1240554
@Override
	public void processRecord(Record record) {
		if (this.sheetIndex > -1 && this.curSheetIndex > this.sheetIndex) {
			// 指定Sheet之后的数据不再处理
			return;
		}

		if (record instanceof BoundSheetRecord) {
			// Sheet边界记录，此Record中可以获得Sheet名
			boundSheetRecords.add((BoundSheetRecord) record);
		} else if (record instanceof SSTRecord) {
			// 静态字符串表
			sstRecord = (SSTRecord) record;
		} else if (record instanceof BOFRecord) {
			BOFRecord bofRecord = (BOFRecord) record;
			if (bofRecord.getType() == BOFRecord.TYPE_WORKSHEET) {
				// 如果有需要，则建立子工作薄
				if (workbookBuildingListener != null && stubWorkbook == null) {
					stubWorkbook = workbookBuildingListener.getStubHSSFWorkbook();
				}
				curSheetIndex++;
			}
		} else if (isProcessCurrentSheet()) {
			if (record instanceof MissingCellDummyRecord) {
				// 空值的操作
				MissingCellDummyRecord mc = (MissingCellDummyRecord) record;
				rowCellList.add(mc.getColumn(), StrUtil.EMPTY);
			} else if (record instanceof LastCellOfRowDummyRecord) {
				// 行结束
				processLastCell((LastCellOfRowDummyRecord) record);
			} else {
				// 处理单元格值
				processCellValue(record);
			}
		}

	}
1131955
@Override
	public void publish(LogRecord record) {
		if (!isLoggable(record)) {
			return;
		}
		synchronized (messages) {
			messages.addLast(record);
			messages.notifyAll();
		}
	}
1130456
public synchronized void writeRecord(String record) {
        long length = record.length() + nlen;
        PrintStream ps = getPrintStream(length, null);
        ps.println(record);
    }
1188200
public void setRecords(java.util.Collection<Record> records) {
        if (records == null) {
            this.records = null;
            return;
        }

        this.records = new com.amazonaws.internal.SdkInternalList<Record>(records);
    }
27989
private void log(ArrayList<PrintWriter> writers, RecordTypes recordType,
                   Keys[] keys, String[] values) {
    log(writers, recordType, keys, values, false);
  }
782323
public void addListener(Record record, FileListener listener)
    {
        super.addListener(record, listener);
        if (listener.getOwner() == this.getRecord())   // Only replicate listeners added to base.
        {
            Iterator<BaseTable> iterator = this.getTables();
            while (iterator.hasNext())
            {
                BaseTable table = iterator.next();
                if ((table != null) && (table != this.getNextTable()))
                {
                    FileListener newBehavior = null;    // Clone the file behaviors
                    try   {
                        newBehavior = (FileListener)listener.clone(); // Clone the file behaviors
                    } catch (CloneNotSupportedException ex)   {
                        newBehavior = null;
                    }
                    record = table.getRecord();
                    if (newBehavior != null)
                        table.addListener(record, newBehavior);     // Add them to the new query
                }
            }
        }
    }