@Override protected void fillBuffer(CyclicBuffer<IAccessEvent> cb, StringBuffer sbuf) { int len = cb.length(); for (int i = 0; i < len; i++) { // sbuf.append(MimeUtility.encodeText(layout.format(cb.getOrCreate()))); IAccessEvent event = cb.get(); sbuf.append(layout.doLayout(event)); } }
@Test public void testAppendNonTriggeringEvent() { LoggingEvent event = new LoggingEvent(); event.setThreadName("thead name"); event.setLevel(Level.DEBUG); appender.subAppend(cb, event); assertEquals(1, cb.length()); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final TEntry other = (TEntry) obj; if (key == null) { if (other.key != null) return false; } else if (!key.equals(other.key)) return false; if (value == null) { if (other.value != null) return false; } else if (!value.equals(other.value)) return false; return true; }
/** * Perform SMTPAppender specific appending actions, mainly adding the event to the appropriate * cyclic buffer. */ protected void subAppend(CyclicBuffer<IAccessEvent> cb, IAccessEvent event) { cb.add(event); }