本文整理汇总了Java中org.apache.logging.log4j.Level.ALL属性的典型用法代码示例。如果您正苦于以下问题:Java Level.ALL属性的具体用法?Java Level.ALL怎么用?Java Level.ALL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.logging.log4j.Level
的用法示例。
在下文中一共展示了Level.ALL属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: log4jLevelToLogWriterLevel
public static int log4jLevelToLogWriterLevel(final Level log4jLevel) {
if (log4jLevel == Level.FATAL) {
return InternalLogWriter.SEVERE_LEVEL;
} else if (log4jLevel == Level.ERROR) {
return InternalLogWriter.ERROR_LEVEL;
} else if (log4jLevel == Level.WARN) {
return InternalLogWriter.WARNING_LEVEL;
} else if (log4jLevel == Level.INFO) {
return InternalLogWriter.INFO_LEVEL;
} else if (log4jLevel == Level.DEBUG) {
return InternalLogWriter.FINE_LEVEL;
} else if (log4jLevel == Level.TRACE) {
return InternalLogWriter.FINEST_LEVEL;
} else if (log4jLevel == Level.ALL) {
return InternalLogWriter.ALL_LEVEL;
} else if (log4jLevel == Level.OFF) {
return InternalLogWriter.NONE_LEVEL;
}
throw new IllegalArgumentException("Unknown Log4J level [" + log4jLevel + "].");
}
示例2: getLogWriterLevel
@Override
public int getLogWriterLevel() {
final Level log4jLevel = this.logWrapper.getLevel();
if (log4jLevel == Level.OFF) {
return InternalLogWriter.NONE_LEVEL;
} else if (log4jLevel == Level.FATAL) {
return InternalLogWriter.SEVERE_LEVEL;
} else if (log4jLevel == Level.ERROR) {
return InternalLogWriter.ERROR_LEVEL;
} else if (log4jLevel == Level.WARN) {
return InternalLogWriter.WARNING_LEVEL;
} else if (log4jLevel == Level.INFO) {
return InternalLogWriter.INFO_LEVEL;
} else if (log4jLevel == Level.DEBUG) {
return InternalLogWriter.FINE_LEVEL;
} else if (log4jLevel == Level.TRACE) {
return InternalLogWriter.FINER_LEVEL;
} else if (log4jLevel == Level.ALL) {
return InternalLogWriter.ALL_LEVEL;
}
throw new IllegalStateException(
"Level " + log4jLevel + " could not be mapped to LogWriter level.");
}
示例3: logWriterLeveltoLog4jLevel
/************************************************************
* Methods to support backwards compatibility between levels.
************************************************************/
public static Level logWriterLeveltoLog4jLevel(final int logWriterLevel) {
switch (logWriterLevel) {
case InternalLogWriter.SEVERE_LEVEL:
return Level.FATAL;
case InternalLogWriter.ERROR_LEVEL:
return Level.ERROR;
case InternalLogWriter.WARNING_LEVEL:
return Level.WARN;
case InternalLogWriter.CONFIG_LEVEL:
return Level.INFO;
case InternalLogWriter.INFO_LEVEL:
return Level.INFO;
case InternalLogWriter.FINE_LEVEL:
return Level.DEBUG;
case InternalLogWriter.FINER_LEVEL:
return Level.DEBUG;
case InternalLogWriter.FINEST_LEVEL:
return Level.TRACE;
case InternalLogWriter.ALL_LEVEL:
return Level.ALL;
case InternalLogWriter.NONE_LEVEL:
return Level.OFF;
}
throw new IllegalArgumentException("Unknown LogWriter level [" + logWriterLevel + "].");
}
示例4: logWriterNametoLog4jLevel
public static Level logWriterNametoLog4jLevel(String levelName) {
if ("all".equalsIgnoreCase(levelName)) {
return Level.ALL;
}
if ("finest".equalsIgnoreCase(levelName)) {
return Level.TRACE;
}
if ("finer".equalsIgnoreCase(levelName)) {
return Level.DEBUG;
}
if ("fine".equalsIgnoreCase(levelName)) {
return Level.DEBUG;
}
if ("config".equalsIgnoreCase(levelName)) {
return Level.INFO;
}
if ("info".equalsIgnoreCase(levelName)) {
return Level.INFO;
}
if ("warning".equalsIgnoreCase(levelName)) {
return Level.WARN;
}
if ("error".equalsIgnoreCase(levelName)) {
return Level.ERROR;
}
if ("severe".equalsIgnoreCase(levelName)) {
return Level.FATAL;
}
if ("none".equalsIgnoreCase(levelName)) {
return Level.OFF;
}
throw new IllegalArgumentException("Unknown LogWriter level [" + levelName + "].");
}