本文整理匯總了Java中ch.qos.logback.classic.Level.toInt方法的典型用法代碼示例。如果您正苦於以下問題:Java Level.toInt方法的具體用法?Java Level.toInt怎麽用?Java Level.toInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ch.qos.logback.classic.Level
的用法示例。
在下文中一共展示了Level.toInt方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: decide
import ch.qos.logback.classic.Level; //導入方法依賴的package包/類
@Override
public FilterReply decide(Marker marker, Logger logger, Level level, String format, Object[] params, Throwable t) {
// cannot use logger.isEnabledFor(level), as it would cause a StackOverflowError by calling this filter again!
if(level.isGreaterOrEqual(logger.getEffectiveLevel()) && format != null) {
switch (level.toInt()) {
case Level.ERROR_INT:
errorCounter.increment();
break;
case Level.WARN_INT:
warnCounter.increment();
break;
case Level.INFO_INT:
infoCounter.increment();
break;
case Level.DEBUG_INT:
debugCounter.increment();
break;
case Level.TRACE_INT:
traceCounter.increment();
break;
}
}
return FilterReply.NEUTRAL;
}
示例2: translate
import ch.qos.logback.classic.Level; //導入方法依賴的package包/類
private static LogOutput.Level translate(Level level) {
switch (level.toInt()) {
case Level.ERROR_INT:
return LogOutput.Level.ERROR;
case Level.WARN_INT:
return LogOutput.Level.WARN;
case Level.INFO_INT:
return LogOutput.Level.INFO;
case Level.TRACE_INT:
return LogOutput.Level.TRACE;
case Level.DEBUG_INT:
default:
return LogOutput.Level.DEBUG;
}
}
示例3: toGelfMessageLevel
import ch.qos.logback.classic.Level; //導入方法依賴的package包/類
private GelfMessageLevel toGelfMessageLevel(Level level) {
switch (level.toInt()) {
case Level.ERROR_INT:
return GelfMessageLevel.ERROR;
case Level.WARN_INT:
return GelfMessageLevel.WARNING;
case Level.DEBUG_INT:
return GelfMessageLevel.DEBUG;
default:
return GelfMessageLevel.INFO;
}
}