本文整理匯總了Java中ch.qos.logback.classic.Level.ERROR屬性的典型用法代碼示例。如果您正苦於以下問題:Java Level.ERROR屬性的具體用法?Java Level.ERROR怎麽用?Java Level.ERROR使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類ch.qos.logback.classic.Level
的用法示例。
在下文中一共展示了Level.ERROR屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getLogbackLogLevel
private Level getLogbackLogLevel(org.slf4j.event.Level slf4jLevel) {
if(slf4jLevel.equals(org.slf4j.event.Level.INFO)) return Level.INFO;
if(slf4jLevel.equals(org.slf4j.event.Level.DEBUG)) return Level.DEBUG;
if(slf4jLevel.equals(org.slf4j.event.Level.WARN)) return Level.WARN;
if(slf4jLevel.equals(org.slf4j.event.Level.ERROR)) return Level.ERROR;
throw new IllegalArgumentException("Unknown log level");
}
示例2: parseStackTraceLine
private void parseStackTraceLine(String line, LogEntry precessor) {
level = Level.ERROR;
message = line;
if (precessor != null) {
timestamp = precessor.timestamp;
index = precessor.index + 1;
} else {
timestamp = -1;
index = 0;
logger.error("Failed to populate '{}' with timestamp", this);
}
}
示例3: setLogLevel
/**
* This method sets the log level (logback).
*/
public void setLogLevel() {
logLevel = System.getProperty("logLevel", LOG_LEVEL_INFO);
Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
Level logLevelSetting;
switch (logLevel.toLowerCase()) {
case LOG_LEVEL_ERROR:
logLevelSetting = Level.ERROR;
break;
case LOG_LEVEL_WARN:
logLevelSetting = Level.WARN;
break;
case LOG_LEVEL_ALL:
logLevelSetting = Level.ALL;
break;
case LOG_LEVEL_TRACE_LOG:
logLevelSetting = Level.TRACE;
break;
case LOG_LEVEL_INFO:
logLevelSetting = Level.INFO;
break;
case LOG_LEVEL_DEBUG:
logLevelSetting = Level.DEBUG;
break;
default:
logLevelSetting = Level.INFO;
break;
}
root.setLevel(logLevelSetting);
}