@Test public void testFormat_EverythingDefault() throws IOException { Containers containers = MessageStreams.resource("/compat/binary.data", new BinarySerializer(), Containers.kDescriptor) .findFirst() .orElseThrow(() -> new AssertionError("resource")); ByteArrayOutputStream baos = new ByteArrayOutputStream(); new PrettySerializer().config().serialize(baos, containers); assertThat(new LogFormatter(true).format(containers), is(equalToLines(new String(baos.toByteArray(), UTF_8)))); }
public <Message extends PMessage<Message, Field>, Field extends PField> String format(Message message) { ByteArrayOutputStream out = new ByteArrayOutputStream(); formatTo(out, message); return new String(out.toByteArray(), StandardCharsets.UTF_8); }
LogFormatter { public <Message extends PMessage<Message, Field>, Field extends PField> String format(Message message) { ByteArrayOutputStream out = new ByteArrayOutputStream(); formatTo(out, message); return new String(out.toByteArray(), StandardCharsets.UTF_8); } }
LogFormatter { public <Message extends PMessage<Message, Field>, Field extends PField> String format(Message message) { ByteArrayOutputStream out = new ByteArrayOutputStream(); formatTo(out, message); return new String(out.toByteArray(), StandardCharsets.UTF_8); } LogFormatter(FieldHandler... fieldHandlers);  LogFormatter(boolean pretty, FieldHandler... fieldHandlers);  LogFormatter(boolean pretty, Collection<FieldHandler> fieldHandlers); }
LogFormatter { public <Message extends PMessage<Message, Field>, Field extends PField> String format(Message message) { ByteArrayOutputStream out = new ByteArrayOutputStream(); formatTo(out, message); return new String(out.toByteArray(), StandardCharsets.UTF_8); } LogFormatter(FieldHandler... fieldHandlers);  LogFormatter(boolean pretty, FieldHandler... fieldHandlers);  LogFormatter(boolean pretty, Collection<FieldHandler> fieldHandlers); void formatTo(OutputStream out, Message message); String format(Message message); }
LogFormatter { public <Message extends PMessage<Message, Field>, Field extends PField> String format(Message message) { ByteArrayOutputStream out = new ByteArrayOutputStream(); formatTo(out, message); return new String(out.toByteArray(), StandardCharsets.UTF_8); } LogFormatter(FieldHandler... fieldHandlers);  LogFormatter(boolean pretty, FieldHandler... fieldHandlers);  LogFormatter(boolean pretty, Collection<FieldHandler> fieldHandlers); void formatTo(OutputStream out, Message message); String format(Message message);  }