Java 类org.apache.logging.log4j.message.MessageFormatMessage 实例源码

项目:logging-log4j2    文件:LoggerSupplierTest.java   
@Test
public void flowTracing_SupplierOfMessageFormatMessage() {
    logger.traceEntry(new Supplier<MessageFormatMessage>() {
        @Override
        public MessageFormatMessage get() {
            return new MessageFormatMessage("int foo={0}", 1234567890);
        }
    });
    assertEquals(1, results.size());
    assertThat("Incorrect Entry", results.get(0), startsWith("ENTER[ FLOW ] TRACE Enter"));
    assertThat("Missing entry data", results.get(0), containsString("(int foo=1,234,567,890)"));
    assertThat("Bad toString()", results.get(0), not(containsString("MessageFormatMessage")));
}
项目:apiman    文件:ApimanLog4j2LogDelegate.java   
private void log(Level level, String message, Throwable t, Object... params) {
  logger.logIfEnabled(FQCN, level, null, new MessageFormatMessage(message, params), t);
}