本文整理汇总了Java中ch.qos.logback.classic.Level.WARN_INT属性的典型用法代码示例。如果您正苦于以下问题:Java Level.WARN_INT属性的具体用法?Java Level.WARN_INT怎么用?Java Level.WARN_INT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类ch.qos.logback.classic.Level
的用法示例。
在下文中一共展示了Level.WARN_INT属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: message
public void message(String msg, Throwable t) {
switch(level) {
case Level.TRACE_INT: {
slf4jLogger.trace(marker, msg, t);
break;
}
case Level.DEBUG_INT: {
slf4jLogger.debug(marker, msg, t);
break;
}
case Level.INFO_INT: {
slf4jLogger.info(marker, msg, t);
break;
}
case Level.WARN_INT: {
slf4jLogger.warn(marker, msg, t);
break;
}
case Level.ERROR_INT: {
slf4jLogger.error(marker, msg, t);
break;
}
}
}
示例2: decide
@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;
}
示例3: append
@Override
protected void append(ILoggingEvent event) {
switch (event.getLevel().toInt()) {
case Level.TRACE_INT:
traceLabel.inc();
break;
case Level.DEBUG_INT:
debugLabel.inc();
break;
case Level.INFO_INT:
infoLabel.inc();
break;
case Level.WARN_INT:
warnLabel.inc();
break;
case Level.ERROR_INT:
errorLabel.inc();
break;
default:
break;
}
}
示例4: writeTo
@Override
public void writeTo(JsonGenerator generator, ILoggingEvent event) throws IOException {
String level;
switch (event.getLevel().toInt()) {
case Level.ERROR_INT:
level = "error";
break;
case Level.WARN_INT:
level = "warning";
break;
case Level.INFO_INT:
level = "info";
break;
case Level.DEBUG_INT:
level = "debug";
break;
case Level.TRACE_INT:
level = "trace";
break;
case Level.ALL_INT:
level = "all";
break;
case Level.OFF_INT:
level = "off";
break;
default:
level = "???";
}
JsonWritingUtils.writeStringField(
generator, getFieldName(), level);
}
示例5: translate
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;
}
}
示例6: toGelfMessageLevel
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;
}
}