Code example for Handler

Methods: flushpublish

0
    assertThat(outputStream2.toString("UTF-8"), equalTo("What thread is this?"));
    assertThat(outputStream3.toString("UTF-8"), equalTo("What thread is this?"));
  } 
 
  private static void publishAndFlush(Handler handler, LogRecord logRecord) {
    handler.publish(logRecord);
    handler.flush();
  } 
 
  private static LogRecord newLogRecordWithThreadId(Level level, String contents, int threadId) {
    LogRecord result = new LogRecord(level, contents);
    result.setThreadID(threadId);
    return result;
  } 
}