本文整理汇总了Java中org.jboss.logging.Logger.Level方法的典型用法代码示例。如果您正苦于以下问题:Java Logger.Level方法的具体用法?Java Logger.Level怎么用?Java Logger.Level使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.logging.Logger
的用法示例。
在下文中一共展示了Logger.Level方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleCustomLog
import org.jboss.logging.Logger; //导入方法依赖的package包/类
private void handleCustomLog(HttpServerExchange exchange, Throwable t, Logger.Level level, Logger.Level stackTraceLevel, String category) {
BasicLogger logger = UndertowLogger.REQUEST_LOGGER;
if (!category.isEmpty()) {
logger = Logger.getLogger(category);
}
boolean stackTrace = true;
if (stackTraceLevel.ordinal() > level.ordinal()) {
if (!logger.isEnabled(stackTraceLevel)) {
stackTrace = false;
}
}
if (stackTrace) {
logger.logf(level, t, "Exception handling request to %s", exchange.getRequestURI());
} else {
logger.logf(level, "Exception handling request to %s: %s", exchange.getRequestURI(), t.getMessage());
}
}
示例2: ExceptionDetails
import org.jboss.logging.Logger; //导入方法依赖的package包/类
private ExceptionDetails(Logger.Level level, Logger.Level stackTraceLevel, String category) {
this.level = level;
this.stackTraceLevel = stackTraceLevel;
this.category = category;
}
示例3: add
import org.jboss.logging.Logger; //导入方法依赖的package包/类
public Builder add(Class<? extends Throwable> exception, String category, Logger.Level level) {
exceptionDetails.put(exception, new ExceptionDetails(level, Logger.Level.FATAL, category));
return this;
}