本文整理匯總了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);