StandardJsonLogger implements JsonLogger { @Override public JsonLogger field(String key, Object value) { try { jsonObject.add(key, gson.toJsonTree(value)); } catch (Exception e) { jsonObject.add(key, gson.toJsonTree(formatException(e))); } return this; } StandardJsonLogger(org.slf4j.Logger slf4jLogger,
                            FastDateFormat formatter, Gson gson,
                            String levelName,
                            Consumer<String> logOperation,
                            BiConsumer<Marker, String> logWithMarkerOperation); boolean isIncludeLoggerName(); void setIncludeLoggerName(boolean includeLoggerName); boolean isIncludeThreadName(); void setIncludeThreadName(boolean includeThreadName); boolean isIncludeClassName(); void setIncludeClassName(boolean includeClassName); @Override JsonLogger message(String message); @Override JsonLogger message(Supplier<String> message); @Override JsonLogger map(String key, Map map); @Override JsonLogger map(String key, Supplier<Map> map); @Override JsonLogger list(String key, List list); @Override JsonLogger list(String key, Supplier<List> list); @Override JsonLogger field(String key, Object value); @Override JsonLogger field(String key, Supplier value); @Override JsonLogger json(String key, JsonElement jsonElement); @Override JsonLogger json(String key, Supplier<JsonElement> jsonElement); @Override JsonLogger exception(String key, Exception exception); @Override JsonLogger stack(); @Override JsonLogger marker(Marker marker); @Override void log();  }
@Test public void field() { logger.field("key", "value").log(); Mockito.verify(this.messageConsumer).accept(Mockito.contains("\"key\":\"value\"")); }