use of org.apache.logging.log4j.message.LocalizedMessage in project logging-log4j2 by apache.
the class LoggerSupplierTest method flowTracing_SupplierOfLocalizedMessage.
@Test
public void flowTracing_SupplierOfLocalizedMessage() {
logger.traceEntry(new Supplier<LocalizedMessage>() {
@Override
public LocalizedMessage get() {
return new LocalizedMessage("int foo={}", 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=1234567890)"));
assertThat("Bad toString()", results.get(0), not(containsString("LocalizedMessage")));
}
use of org.apache.logging.log4j.message.LocalizedMessage in project logging-log4j2 by apache.
the class Category method l7dlog.
public void l7dlog(final Priority priority, final String key, final Throwable t) {
if (isEnabledFor(priority)) {
final Message msg = new LocalizedMessage(bundle, key, null);
forcedLog(FQCN, priority, msg, t);
}
}
use of org.apache.logging.log4j.message.LocalizedMessage in project logging-log4j2 by apache.
the class Category method l7dlog.
public void l7dlog(final Priority priority, final String key, final Object[] params, final Throwable t) {
if (isEnabledFor(priority)) {
final Message msg = new LocalizedMessage(bundle, key, params);
forcedLog(FQCN, priority, msg, t);
}
}
Aggregations