use of org.apache.logging.log4j.message.StringFormattedMessage in project logging-log4j2 by apache.
the class AbstractLogger method printf.
@Override
public void printf(final Level level, final String format, final Object... params) {
if (isEnabled(level, null, format, params)) {
final Message msg = new StringFormattedMessage(format, params);
logMessageSafely(FQCN, level, null, msg, msg.getThrowable());
}
}
use of org.apache.logging.log4j.message.StringFormattedMessage in project logging-log4j2 by apache.
the class LoggerSupplierTest method flowTracing_SupplierOfStringFormattedMessage.
@Test
public void flowTracing_SupplierOfStringFormattedMessage() {
logger.traceEntry(() -> new StringFormattedMessage("int foo=%,d", 1234567890));
assertThat(results).hasSize(1);
String entry = results.get(0);
assertThat(entry).startsWith("ENTER[ FLOW ] TRACE Enter").contains("(int foo=1,234,567,890)").doesNotContain("StringFormattedMessage");
}
use of org.apache.logging.log4j.message.StringFormattedMessage in project logging-log4j2 by apache.
the class AbstractLogger method printf.
@Override
public void printf(final Level level, final Marker marker, final String format, final Object... params) {
if (isEnabled(level, marker, format, params)) {
final Message msg = new StringFormattedMessage(format, params);
logMessageSafely(FQCN, level, marker, msg, msg.getThrowable());
}
}
Aggregations