本文整理汇总了Java中ch.qos.logback.core.spi.FilterReply.ACCEPT属性的典型用法代码示例。如果您正苦于以下问题:Java FilterReply.ACCEPT属性的具体用法?Java FilterReply.ACCEPT怎么用?Java FilterReply.ACCEPT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类ch.qos.logback.core.spi.FilterReply
的用法示例。
在下文中一共展示了FilterReply.ACCEPT属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decide
@Override
public FilterReply decide(Marker marker, Logger logger, Level level, String format, Object[] params, Throwable t)
{
//System.out.println("** Being called "+logger+"**"+level+"**"+marker);
ConfigValueTuple override = loggerOverrides.get(logger);
if(override != null)
{
Level configLevel = Level.toLevel(override.getLevel());
if(level.isGreaterOrEqual(configLevel))
return FilterReply.ACCEPT;
else
return FilterReply.DENY;
}
else
return FilterReply.NEUTRAL;
}
示例2: decide
@Override
public FilterReply decide(ILoggingEvent event)
{
int xx = event.getLevel().levelInt;
int xx1 = Level.ERROR.toInt(); //error:40000, warn:30000, info:20000
if (xx >= xx1)
{
JFrameMain.getInstance().getMsgTextArea().append(event.getFormattedMessage() + System.lineSeparator());
}
return FilterReply.ACCEPT;
}
示例3: decide
@Override
public FilterReply decide(ILoggingEvent event) {
if (isEclipse) {
// 只有在eclipse启动时才输出
return FilterReply.ACCEPT;
} else {
return FilterReply.DENY;
}
}
示例4: getTurboFilterChainDecision
public FilterReply getTurboFilterChainDecision(Marker marker,
KonkerLogger logger,
Level level,
String format,
Object[] params,
Throwable t) {
int size = this.size();
if(size == 1) {
try {
KonkerTurboFilter filter = this.get(0);
return filter.decide(marker, logger, level, format, params, t);
} catch (IndexOutOfBoundsException var13) {
return FilterReply.NEUTRAL;
}
} else {
Object[] tfa = this.toArray();
int len = tfa.length;
for(int i = 0; i < len; ++i) {
KonkerTurboFilter tf = (KonkerTurboFilter) tfa[i];
FilterReply r = tf.decide(marker, logger, level, format, params, t);
if(r == FilterReply.DENY || r == FilterReply.ACCEPT) {
return r;
}
}
return FilterReply.NEUTRAL;
}
}
示例5: isDebugEnabled
public boolean isDebugEnabled(Marker marker) {
FilterReply decision = this.callTurboFilters(marker, Level.DEBUG);
if(decision == FilterReply.NEUTRAL) {
return this.effectiveLevelInt <= 10000;
} else if(decision == FilterReply.DENY) {
return false;
} else if(decision == FilterReply.ACCEPT) {
return true;
} else {
throw new IllegalStateException("Unknown FilterReply value: " + decision);
}
}
示例6: isInfoEnabled
public boolean isInfoEnabled(Marker marker) {
FilterReply decision = this.callTurboFilters(marker, Level.INFO);
if(decision == FilterReply.NEUTRAL) {
return this.effectiveLevelInt <= 20000;
} else if(decision == FilterReply.DENY) {
return false;
} else if(decision == FilterReply.ACCEPT) {
return true;
} else {
throw new IllegalStateException("Unknown FilterReply value: " + decision);
}
}
示例7: isTraceEnabled
public boolean isTraceEnabled(Marker marker) {
FilterReply decision = this.callTurboFilters(marker, Level.TRACE);
if(decision == FilterReply.NEUTRAL) {
return this.effectiveLevelInt <= 5000;
} else if(decision == FilterReply.DENY) {
return false;
} else if(decision == FilterReply.ACCEPT) {
return true;
} else {
throw new IllegalStateException("Unknown FilterReply value: " + decision);
}
}
示例8: isErrorEnabled
public boolean isErrorEnabled(Marker marker) {
FilterReply decision = this.callTurboFilters(marker, Level.ERROR);
if(decision == FilterReply.NEUTRAL) {
return this.effectiveLevelInt <= '鱀';
} else if(decision == FilterReply.DENY) {
return false;
} else if(decision == FilterReply.ACCEPT) {
return true;
} else {
throw new IllegalStateException("Unknown FilterReply value: " + decision);
}
}
示例9: isWarnEnabled
public boolean isWarnEnabled(Marker marker) {
FilterReply decision = this.callTurboFilters(marker, Level.WARN);
if(decision == FilterReply.NEUTRAL) {
return this.effectiveLevelInt <= 30000;
} else if(decision == FilterReply.DENY) {
return false;
} else if(decision == FilterReply.ACCEPT) {
return true;
} else {
throw new IllegalStateException("Unknown FilterReply value: " + decision);
}
}
示例10: isEnabledFor
public boolean isEnabledFor(Marker marker, Level level) {
FilterReply decision = this.callTurboFilters(marker, level);
if(decision == FilterReply.NEUTRAL) {
return this.effectiveLevelInt <= level.levelInt;
} else if(decision == FilterReply.DENY) {
return false;
} else if(decision == FilterReply.ACCEPT) {
return true;
} else {
throw new IllegalStateException("Unknown FilterReply value: " + decision);
}
}
示例11: decide
@Override
public FilterReply decide(Marker marker, Logger logger, Level level, String format, Object[] params, Throwable t) {
String logLevel = MDC.get(DynamicLogLevelHelper.MDC_DYNAMIC_LOG_LEVEL_KEY);
if (logLevel == null) {
return FilterReply.NEUTRAL;
}
if (level.isGreaterOrEqual(Level.toLevel(logLevel))) {
return FilterReply.ACCEPT;
}
return FilterReply.DENY;
}
示例12: setOnMatch
/**
* @param onMatch action to set on success
*/
public void setOnMatch(String action) {
if ("NEUTRAL".equals(action)) {
this.onMatch = FilterReply.NEUTRAL;
} else if ("ACCEPT".equals(action)) {
this.onMatch = FilterReply.ACCEPT;
} else {
this.onMatch = FilterReply.DENY;
}
}
示例13: setOnMismatch
/**
* @param onMismatch the onMismatch to set on failure
*/
public void setOnMismatch(String action) {
if ("NEUTRAL".equals(action)) {
this.onMismatch = FilterReply.NEUTRAL;
} else if ("ACCEPT".equals(action)) {
this.onMismatch = FilterReply.ACCEPT;
} else {
this.onMismatch = FilterReply.DENY;
}
}
示例14: decide
@Override
public FilterReply decide(ILoggingEvent event) {
if(event.getMessage().contains("TEST"))
return FilterReply.ACCEPT;
else
return FilterReply.DENY;
}
示例15: isDebugEnabled
public boolean isDebugEnabled(Marker marker) {
final FilterReply decision = callTurboFilters(marker, Level.DEBUG);
if (decision == FilterReply.NEUTRAL) {
return effectiveLevelInt <= Level.DEBUG_INT;
} else if (decision == FilterReply.DENY) {
return false;
} else if (decision == FilterReply.ACCEPT) {
return true;
} else {
throw new IllegalStateException("Unknown FilterReply value: " + decision);
}
}