當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。