本文整理汇总了Java中org.apache.log4j.Level.toInt方法的典型用法代码示例。如果您正苦于以下问题:Java Level.toInt方法的具体用法?Java Level.toInt怎么用?Java Level.toInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.log4j.Level
的用法示例。
在下文中一共展示了Level.toInt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mapLevel
import org.apache.log4j.Level; //导入方法依赖的package包/类
private int mapLevel(Level level) {
switch (level.toInt()) {
case Priority.DEBUG_INT:
case Priority.INFO_INT:
return IStatus.INFO;
case Priority.WARN_INT:
return IStatus.WARNING;
case Priority.ERROR_INT:
case Priority.FATAL_INT:
return IStatus.ERROR;
default:
return IStatus.INFO;
}
}
示例2: LogWriter
import org.apache.log4j.Level; //导入方法依赖的package包/类
/**
* Constructor.
*
* @param logger the logger this Writer should write to
* @param level the debug level to write to the logger with
*/
public LogWriter(final Logger logger, final Level level) {
Preconditions.checkNotNull(logger);
Preconditions.checkArgument((level == Level.DEBUG) || (level == Level.ERROR) ||
(level == Level.INFO) || (level == Level.TRACE) || (level == Level.WARN),
"level must be a logging level");
this.logger = logger;
this.level = level.toInt();
stringBuilder = new StringBuilder(80);
isClosed = false;
}
示例3: isDoLog
import org.apache.log4j.Level; //导入方法依赖的package包/类
private boolean isDoLog(Level level) {
return level.toInt() >= Priority.WARN_INT;
}