本文整理匯總了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;
}