} else { record.disableCallerCalculation();
protected void doPublish(final ExtLogRecord record) { synchronized (buffer) { if (isLoggable(record)) { // Determine if we need to calculate the caller information before we queue the record if (isCallerCalculationRequired()) { // prepare record to move to another thread record.copyAll(); } else { // Disable the caller calculation since it's been determined we won't be using it record.disableCallerCalculation(); // Copy the MDC over record.copyMdc(); // In case serialization is required by a child handler record.getFormattedMessage(); } if (buffer.size() == limit) { buffer.removeFirst(); } buffer.addLast(record); } for (Handler handler : getHandlers()) { handler.publish(record); } } }
record.setThreadName(threadName == null ? "<unknown>" : threadName); record.setThrown(throwableInfo == null ? null : throwableInfo.getThrowable()); record.disableCallerCalculation(); cachedLocationInfo = new LocationInfo(null, null); try {
@Override protected void doPublish(final ExtLogRecord record) { // If activated just delegate if (activated) { publishToChildren(record); super.doPublish(record); } else { synchronized (this) { // Check one more time to see if we've been activated before queuing the messages if (activated) { publishToChildren(record); super.doPublish(record); } else { // Determine if we need to calculate the caller information before we queue the record if (isCallerCalculationRequired()) { // prepare record to move to another thread record.copyAll(); } else { // Disable the caller calculation since it's been determined we won't be using it record.disableCallerCalculation(); // Copy the MDC over record.copyMdc(); // In case serialization is required by a child handler record.getFormattedMessage(); } logRecords.addLast(record); } } } }