本文整理汇总了Java中org.apache.logging.log4j.core.Filter.Result方法的典型用法代码示例。如果您正苦于以下问题:Java Filter.Result方法的具体用法?Java Filter.Result怎么用?Java Filter.Result使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.logging.log4j.core.Filter
的用法示例。
在下文中一共展示了Filter.Result方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testUnrolledBackwardsCompatible
import org.apache.logging.log4j.core.Filter; //导入方法依赖的package包/类
@Test
public void testUnrolledBackwardsCompatible() {
final ConcreteFilter filter = new ConcreteFilter();
final Filter.Result expected = Filter.Result.DENY;
verifyMethodsWithUnrolledVarargs(filter, Filter.Result.DENY);
filter.testResult = Filter.Result.ACCEPT;
verifyMethodsWithUnrolledVarargs(filter, Filter.Result.ACCEPT);
}
示例2: verifyMethodsWithUnrolledVarargs
import org.apache.logging.log4j.core.Filter; //导入方法依赖的package包/类
private void verifyMethodsWithUnrolledVarargs(final ConcreteFilter filter, final Filter.Result expected) {
final Logger logger = null;
final Level level = null;
final Marker marker = null;
assertEquals(expected, filter.filter(logger, level, marker, "", 1));
assertEquals(expected, filter.filter(logger, level, marker, "", 1, 2));
assertEquals(expected, filter.filter(logger, level, marker, "", 1, 2, 3));
assertEquals(expected, filter.filter(logger, level, marker, "", 1, 2, 3, 4));
assertEquals(expected, filter.filter(logger, level, marker, "", 1, 2, 3, 4, 5));
assertEquals(expected, filter.filter(logger, level, marker, "", 1, 2, 3, 4, 5, 6));
assertEquals(expected, filter.filter(logger, level, marker, "", 1, 2, 3, 4, 5, 6, 7));
assertEquals(expected, filter.filter(logger, level, marker, "", 1, 2, 3, 4, 5, 6, 7, 8));
assertEquals(expected, filter.filter(logger, level, marker, "", 1, 2, 3, 4, 5, 6, 7, 8, 9));
assertEquals(expected, filter.filter(logger, level, marker, "", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
}
示例3: filter
import org.apache.logging.log4j.core.Filter; //导入方法依赖的package包/类
@Override
public Filter.Result filter(final LogEvent event) {
return event.getThreadName().equals(Thread.currentThread().getName()) ? onMatch : onMismatch;
}
示例4: newFilter
import org.apache.logging.log4j.core.Filter; //导入方法依赖的package包/类
@Override
public FilterComponentBuilder newFilter(final String type, final Filter.Result onMatch,
final Filter.Result onMismatch) {
return new DefaultFilterComponentBuilder(this, type, onMatch.name(), onMismatch.name());
}
示例5: newFilter
import org.apache.logging.log4j.core.Filter; //导入方法依赖的package包/类
/**
* Returns a builder for creating Filters.
* @param pluginName The Plugin type of the Filter.
* @param onMatch "ACCEPT", "DENY", or "NEUTRAL"
* @param onMismatch "ACCEPT", "DENY", or "NEUTRAL"
* @return A new FilterComponentBuilder.
*/
FilterComponentBuilder newFilter(String pluginName, Filter.Result onMatch, Filter.Result onMismatch);