本文整理汇总了Java中org.apache.logging.log4j.message.FormattedMessage类的典型用法代码示例。如果您正苦于以下问题:Java FormattedMessage类的具体用法?Java FormattedMessage怎么用?Java FormattedMessage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FormattedMessage类属于org.apache.logging.log4j.message包,在下文中一共展示了FormattedMessage类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: log
import org.apache.logging.log4j.message.FormattedMessage; //导入依赖的package包/类
@Override
public void log(Marker marker, String fqcn, Level level, Message data, Throwable t) {
if (ConfigHandler.textureErrorRemover != 0) {
if (t instanceof FileNotFoundException) {
if (ConfigHandler.textureErrorRemover == 1) {
super.log(marker, fqcn, level, data, null);
}
removed++;
} else {
super.log(marker, fqcn, level, data, t);
}
if (data.getFormat().startsWith("Created:")) {
EnderCore.logger.info(ConfigHandler.textureErrorRemover == 1 ? new FormattedMessage("Removed %d missing texture stacktraces. Tada!", removed)
: new FormattedMessage("There were %d missing texture errors here. They're gone now.", removed));
removed = 0;
}
return;
}
super.log(marker, fqcn, level, data, t);
}
示例2: flowTracing_SupplierOfFormattedMessage
import org.apache.logging.log4j.message.FormattedMessage; //导入依赖的package包/类
@Test
public void flowTracing_SupplierOfFormattedMessage() {
logger.traceEntry(new Supplier<FormattedMessage>() {
@Override
public FormattedMessage get() {
return new FormattedMessage("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("FormattedMessage")));
}