Search in sources :

Example 1 with SimpleMessageFactory

use of org.apache.logging.log4j.message.SimpleMessageFactory in project logging-log4j2 by apache.

the class LoggerTest method getLogger_String_SimpleMessageFactory.

@Test
public void getLogger_String_SimpleMessageFactory() {
    final SimpleMessageFactory messageFactory = SimpleMessageFactory.INSTANCE;
    final TestLogger testLogger = (TestLogger) LogManager.getLogger("getLogger_String_StringFormatterMessageFactory", messageFactory);
    assertNotNull(testLogger);
    assertEqualMessageFactory(messageFactory, testLogger);
    testLogger.debug("{} %,d {foo}", Integer.MAX_VALUE);
    assertEquals(1, testLogger.getEntries().size());
    assertEquals(" DEBUG {} %,d {foo}", testLogger.getEntries().get(0));
}
Also used : SimpleMessageFactory(org.apache.logging.log4j.message.SimpleMessageFactory) Test(org.junit.Test)

Aggregations

SimpleMessageFactory (org.apache.logging.log4j.message.SimpleMessageFactory)1 Test (org.junit.Test)1