/** * Replay the stored queue to the nested handlers. */ public void replay() { final Handler[] handlers = getHandlers(); if (handlers.length > 0) for (ExtLogRecord record : getQueue()) { for (Handler handler : handlers) { handler.publish(record); } } }
/** * Get a copy of the queue, rendering each record as a string. * * @return the copy of the queue rendered as strings */ public String[] getQueueAsStrings() { final ExtLogRecord[] queue = getQueue(); final int length = queue.length; final String[] strings = new String[length]; final Formatter formatter = getFormatter(); for (int i = 0, j = 0; j < length; j++) { final String formatted; try { formatted = formatter.format(queue[j]); if (formatted.length() > 0) { strings[i++] = getFormatter().format(queue[j]); } } catch (Exception ex) { reportError("Formatting error", ex, ErrorManager.FORMAT_FAILURE); } } return strings; }