本文整理汇总了Java中org.apache.logging.log4j.Level.DEBUG属性的典型用法代码示例。如果您正苦于以下问题:Java Level.DEBUG属性的具体用法?Java Level.DEBUG怎么用?Java Level.DEBUG使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.logging.log4j.Level
的用法示例。
在下文中一共展示了Level.DEBUG属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convert
private static Level convert(final LogLevel logLevel) {
switch (logLevel) {
case FATAL:
return Level.FATAL;
case ERROR:
return Level.ERROR;
case WARN:
return Level.WARN;
case INFO:
return Level.INFO;
case DEBUG:
return Level.DEBUG;
case TRACE:
return Level.TRACE;
case OFF:
return Level.OFF;
default:
return Level.toLevel(logLevel.name());
}
}
示例2: 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 + "].");
}
示例3: 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.");
}
示例4: logEventShouldMatchCustomConfig
@Test
public void logEventShouldMatchCustomConfig() throws Exception {
String logLogger = getClass().getName();
Level logLevel = Level.DEBUG;
String logMessage = "this is a log statement";
Logger logger = LogService.getLogger();
logger.debug(logMessage);
BasicAppender appender = BasicAppender.getInstance();
assertThat(appender).isNotNull();
assertThat(appender.events()).hasSize(1);
LogEvent event = appender.events().get(0);
assertThat(event.getLoggerName()).isEqualTo(logLogger);
assertThat(event.getLevel()).isEqualTo(logLevel);
assertThat(event.getMessage().getFormattedMessage()).isEqualTo(logMessage);
assertThat(systemOutRule.getLog()).contains(logLevel.name());
assertThat(systemOutRule.getLog()).contains(logMessage);
assertThat(systemOutRule.getLog()).contains(CONFIG_LAYOUT_PREFIX);
assertThat(systemOutRule.getLog()).matches(defineLogStatementRegex(logLevel, logMessage));
}
示例5: toLevel
protected Level toLevel(InternalLogLevel level) {
switch (level) {
case INFO:
return Level.INFO;
case DEBUG:
return Level.DEBUG;
case WARN:
return Level.WARN;
case ERROR:
return Level.ERROR;
case TRACE:
return Level.TRACE;
default:
throw new Error();
}
}
示例6: apply
@Override
public void apply(Pointer voidPtr1, int levelID, Pointer formatPtr, Pointer args) {
Level level;
switch(levelID) { // SEE FFmpeg libavutil/log.h
case AV_LOG_QUIET:
case AV_LOG_TRACE:
level = Level.TRACE; break;
case AV_LOG_PANIC:
case AV_LOG_FATAL:
level = Level.FATAL; break;
case AV_LOG_ERROR:
level = Level.ERROR; break;
case AV_LOG_WARNING:
level = Level.WARN; break;
case AV_LOG_INFO:
level = Level.INFO; break;
case AV_LOG_VERBOSE:
case AV_LOG_DEBUG:
level = Level.DEBUG; break;
default:
level = Level.DEBUG;
}
Memory line = new Memory(128L);
Avutil55Library.INSTANCE.av_log_format_line(voidPtr1, levelID, formatPtr, args, line.share(0), 128, prefix);
String message = String.format(line.getString(0), args).trim();
logger.log(level, message);
}
示例7: 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 + "].");
}
示例8: 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 + "].");
}
示例9: isDebugEnabled
public static boolean isDebugEnabled() {
return loglevel == Level.DEBUG;
}
示例10: Log4JConfig
/**
* Log config constructor with default log level of INFO
* @author ThatsNoMoon
*/
public Log4JConfig() {
JUKEBOT_LOG_LEVEL = Level.DEBUG;
LIB_LOG_LEVEL = Level.INFO;
}
示例11: getLevel
/**
* Gets the level.
*
* @return the level
*/
@Override
public Level getLevel() {
return Level.DEBUG;
}