当前位置: 首页>>代码示例>>Java>>正文


Java Filter.Result方法代码示例

本文整理汇总了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);
}
 
开发者ID:apache,项目名称:logging-log4j2,代码行数:10,代码来源:AbstractFilterTest.java

示例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));
}
 
开发者ID:apache,项目名称:logging-log4j2,代码行数:16,代码来源:AbstractFilterTest.java

示例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;
}
 
开发者ID:OuZhencong,项目名称:log4j2,代码行数:5,代码来源:AbstractSocketServerTest.java

示例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());
}
 
开发者ID:apache,项目名称:logging-log4j2,代码行数:6,代码来源:DefaultConfigurationBuilder.java

示例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);
 
开发者ID:apache,项目名称:logging-log4j2,代码行数:9,代码来源:ConfigurationBuilder.java


注:本文中的org.apache.logging.log4j.core.Filter.Result方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。