PlainFormatter implements LoggerFormatter { @Override public String apply(Level level, String name, String message) { requireNonNull(level); requireNonNull(name); return new StringBuilder() .append(Instant.now().truncatedTo(ChronoUnit.MILLIS).toString()) .append(" ") .append(level.toText()) .append(" [") .append(Thread.currentThread().getName()) .append("] (") .append(name) .append(") - ") .append(message) .toString(); }  @Override String apply(Level level, String name, String message);  }
@Test void testApply() { final String actual = instance.apply(Level.DEBUG, "LOGGER_NAME", "Some message"); assertTrue(actual.contains("DEBUG")); assertTrue(actual.contains("LOGGER_NAME")); assertTrue(actual.contains("Some message")); assertTrue(actual.contains("-")); assertTrue(actual.contains(":")); assertTrue(actual.contains("T")); assertTrue(actual.contains("Z")); }