/** * Outputs the record separator. * * @throws IOException * If an I/O error occurs */ public void println() throws IOException { format.println(out); newRecord = true; }
/** * Prints the given {@code values} to {@code out} as a single record of delimiter separated values followed by the * record separator. * * <p> * The values will be quoted if needed. Quotes and new-line characters will be escaped. This method adds the record * separator to the output after printing the record, so there is no need to call {@link #println(Appendable)}. * </p> * * @param out * where to write. * @param values * values to output. * @throws IOException * If an I/O error occurs. * @since 1.4 */ public void printRecord(final Appendable out, final Object... values) throws IOException { for (int i = 0; i < values.length; i++) { print(values[i], out, i == 0); } println(out); }
/** * Outputs the record separator. * * @throws IOException * If an I/O error occurs */ public void println() throws IOException { format.println(out); newRecord = true; }
/** * Outputs the record separator. * * @throws IOException * If an I/O error occurs */ public void println() throws IOException { format.println(out); newRecord = true; }
/** * Prints the given {@code values} to {@code out} as a single record of delimiter separated values followed by the * record separator. * * <p> * The values will be quoted if needed. Quotes and new-line characters will be escaped. This method adds the record * separator to the output after printing the record, so there is no need to call {@link #println(Appendable)}. * </p> * * @param out * where to write. * @param values * values to output. * @throws IOException * If an I/O error occurs. * @since 1.4 */ public void printRecord(final Appendable out, final Object... values) throws IOException { for (int i = 0; i < values.length; i++) { print(values[i], out, i == 0); } println(out); }
/** * Prints the given {@code values} to {@code out} as a single record of delimiter separated values followed by the * record separator. * * <p> * The values will be quoted if needed. Quotes and new-line characters will be escaped. This method adds the record * separator to the output after printing the record, so there is no need to call {@link #println(Appendable)}. * </p> * * @param out * where to write. * @param values * values to output. * @throws IOException * If an I/O error occurs. * @since 1.4 */ public void printRecord(final Appendable out, final Object... values) throws IOException { for (int i = 0; i < values.length; i++) { print(values[i], out, i == 0); } println(out); }
@Override public String toSerializable(final LogEvent event) { final StringBuilder buffer = getStringBuilder(); final CSVFormat format = getFormat(); try { format.print(event.getNanoTime(), buffer, true); format.print(event.getTimeMillis(), buffer, false); format.print(event.getLevel(), buffer, false); format.print(event.getThreadId(), buffer, false); format.print(event.getThreadName(), buffer, false); format.print(event.getThreadPriority(), buffer, false); format.print(event.getMessage().getFormattedMessage(), buffer, false); format.print(event.getLoggerFqcn(), buffer, false); format.print(event.getLoggerName(), buffer, false); format.print(event.getMarker(), buffer, false); format.print(event.getThrownProxy(), buffer, false); format.print(event.getSource(), buffer, false); format.print(event.getContextData(), buffer, false); format.print(event.getContextStack(), buffer, false); format.println(buffer); return buffer.toString(); } catch (final IOException e) { StatusLogger.getLogger().error(event.toString(), e); return format.getCommentMarker() + " " + e; } }