use of org.apache.logging.log4j.message.ParameterizedMessageFactory in project geode by apache.
the class FastLoggerJUnitTest method setUp.
@Before
public void setUp() {
this.messageFactory = new ParameterizedMessageFactory();
this.mockedLogger = mock(ExtendedLogger.class);
this.mockedMarker = mock(Marker.class);
when(this.mockedLogger.getMessageFactory()).thenReturn(this.messageFactory);
when(this.mockedMarker.getName()).thenReturn("MARKER");
}
use of org.apache.logging.log4j.message.ParameterizedMessageFactory in project logging-log4j2 by apache.
the class LoggerTest method getLogger_Object_ParameterizedMessageFactory.
@Test
public void getLogger_Object_ParameterizedMessageFactory() {
// The TestLogger logger was already created in an instance variable for this class.
// The message factory is only used when the logger is created.
final ParameterizedMessageFactory messageFactory = ParameterizedMessageFactory.INSTANCE;
final TestLogger testLogger = (TestLogger) LogManager.getLogger(new TestParameterizedMessageFactory(), messageFactory);
assertNotNull(testLogger);
assertEqualMessageFactory(messageFactory, testLogger);
testLogger.debug("{}", Integer.MAX_VALUE);
assertEquals(1, testLogger.getEntries().size());
assertEquals(" DEBUG " + Integer.MAX_VALUE, testLogger.getEntries().get(0));
}
use of org.apache.logging.log4j.message.ParameterizedMessageFactory in project logging-log4j2 by apache.
the class LoggerTest method getLogger_String_ParameterizedMessageFactory.
@Test
public void getLogger_String_ParameterizedMessageFactory() {
final ParameterizedMessageFactory messageFactory = ParameterizedMessageFactory.INSTANCE;
final TestLogger testLogger = (TestLogger) LogManager.getLogger("getLogger_String_ParameterizedMessageFactory", messageFactory);
assertNotNull(testLogger);
assertEqualMessageFactory(messageFactory, testLogger);
testLogger.debug("{}", Integer.MAX_VALUE);
assertEquals(1, testLogger.getEntries().size());
assertEquals(" DEBUG " + Integer.MAX_VALUE, testLogger.getEntries().get(0));
}
use of org.apache.logging.log4j.message.ParameterizedMessageFactory in project logging-log4j2 by apache.
the class LoggerTest method getLogger_Class_ParameterizedMessageFactory.
@Test
public void getLogger_Class_ParameterizedMessageFactory() {
// The TestLogger logger was already created in an instance variable for this class.
// The message factory is only used when the logger is created.
final ParameterizedMessageFactory messageFactory = ParameterizedMessageFactory.INSTANCE;
final TestLogger testLogger = (TestLogger) LogManager.getLogger(TestParameterizedMessageFactory.class, messageFactory);
assertNotNull(testLogger);
assertEqualMessageFactory(messageFactory, testLogger);
testLogger.debug("{}", Integer.MAX_VALUE);
assertEquals(1, testLogger.getEntries().size());
assertEquals(" DEBUG " + Integer.MAX_VALUE, testLogger.getEntries().get(0));
}
Aggregations