LogEvent { String info() { var now = Instant.now(); var builder = new StringBuilder(256); builder.append(DateTimeFormatter.ISO_INSTANT.format(now)) .append(" [").append(Network.LOCAL_HOST_NAME).append("] [").append(Thread.currentThread().getName()).append("] ") .append(level.name()) .append(' ') .append(logger) .append(" - "); if (marker != null) builder.append('[').append(marker.getName()).append("] "); LogManager.FILTER.append(builder, message, arguments); builder.append(System.lineSeparator()); if (exception != null) builder.append(Exceptions.stackTrace(exception)); return builder.toString(); } LogEvent(String logger, Marker marker, LogLevel level, String message, Object[] arguments, Throwable exception);   }
@Test void info() { var event = new LogEvent("logger", Markers.errorCode("ERROR_CODE"), LogLevel.WARN, "message-{}", new Object[]{1}, new Error()); String message = event.info(); assertThat(message).contains("WARN logger - [ERROR_CODE] message-1"); }