@Test public void testAppend() { final SystemLogAppender a = new SystemLogAppender(); a.setLayout(new SimpleLayout()); a.append(new LoggingEvent("f", Logger.getLogger(SystemLogAppender.class), Level.ERROR, "Test", new RuntimeException())); }
@Override protected void append(final LoggingEvent event) { if(null == event.getMessage()) { return; } final StringBuilder buffer = new StringBuilder(); buffer.append(layout.format(event)); if(layout.ignoresThrowable()) { final String[] trace = event.getThrowableStrRep(); if(trace != null) { buffer.append(Layout.LINE_SEP); for(final String t : trace) { buffer.append(t).append(Layout.LINE_SEP); } } } library.NSLog("%@", buffer.toString()); }
SystemLogAppender extends AppenderSkeleton { @Override protected void append(final LoggingEvent event) { if(null == event.getMessage()) { return; } final StringBuilder buffer = new StringBuilder(); buffer.append(layout.format(event)); if(layout.ignoresThrowable()) { final String[] trace = event.getThrowableStrRep(); if(trace != null) { buffer.append(Layout.LINE_SEP); for(final String t : trace) { buffer.append(t).append(Layout.LINE_SEP); } } } library.NSLog("%@", buffer.toString()); } }
SystemLogAppender extends AppenderSkeleton { @Override protected void append(final LoggingEvent event) { if(null == event.getMessage()) { return; } final StringBuilder buffer = new StringBuilder(); buffer.append(layout.format(event)); if(layout.ignoresThrowable()) { final String[] trace = event.getThrowableStrRep(); if(trace != null) { buffer.append(Layout.LINE_SEP); for(final String t : trace) { buffer.append(t).append(Layout.LINE_SEP); } } } library.NSLog("%@", buffer.toString()); }  }
SystemLogAppender extends AppenderSkeleton { @Override protected void append(final LoggingEvent event) { if(null == event.getMessage()) { return; } final StringBuilder buffer = new StringBuilder(); buffer.append(layout.format(event)); if(layout.ignoresThrowable()) { final String[] trace = event.getThrowableStrRep(); if(trace != null) { buffer.append(Layout.LINE_SEP); for(final String t : trace) { buffer.append(t).append(Layout.LINE_SEP); } } } library.NSLog("%@", buffer.toString()); }  @Override void close(); @Override boolean requiresLayout(); }
SystemLogAppender extends AppenderSkeleton { @Override protected void append(final LoggingEvent event) { if(null == event.getMessage()) { return; } final StringBuilder buffer = new StringBuilder(); buffer.append(layout.format(event)); if(layout.ignoresThrowable()) { final String[] trace = event.getThrowableStrRep(); if(trace != null) { buffer.append(Layout.LINE_SEP); for(final String t : trace) { buffer.append(t).append(Layout.LINE_SEP); } } } library.NSLog("%@", buffer.toString()); }  @Override void close(); @Override boolean requiresLayout();  }