本文整理匯總了Java中java.util.logging.Level.getName方法的典型用法代碼示例。如果您正苦於以下問題:Java Level.getName方法的具體用法?Java Level.getName怎麽用?Java Level.getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.logging.Level
的用法示例。
在下文中一共展示了Level.getName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: toLog4j
import java.util.logging.Level; //導入方法依賴的package包/類
@Nonnull
private org.apache.logging.log4j.Level toLog4j(@Nonnull Level level) {
switch (level.getName()) {
case "SEVERE":
return org.apache.logging.log4j.Level.ERROR;
case "WARNING":
return org.apache.logging.log4j.Level.WARN;
case "INFO":
return org.apache.logging.log4j.Level.INFO;
case "CONFIG":
return org.apache.logging.log4j.Level.DEBUG;
case "FINE":
return org.apache.logging.log4j.Level.DEBUG;
case "FINER":
return org.apache.logging.log4j.Level.TRACE;
case "FINEST":
return org.apache.logging.log4j.Level.ALL;
default:
return org.apache.logging.log4j.Level.INFO;
}
}
示例2: LogLevelMenu
import java.util.logging.Level; //導入方法依賴的package包/類
public LogLevelMenu() {
super("log_level");
for (final Level level : LogViewer.SELECTABLE_LEVELS) {
JMenuItem item = new JMenuItem(new AbstractAction(level.getName()) {
private static final long serialVersionUID = 1L;
@Override
public void actionPerformed(ActionEvent e) {
new Thread(new Runnable() {
@Override
public void run() {
// change the log level outside the EDT
// no progress thread because the part that may take some time (the
// GUI refresh by Swing) cannot be cancelled anyway
setLogLevel(level);
}
}).start();
}
});
// highlight current log level
if (getLogSelectionModel().getCurrentLogModel() != null) {
if (level.equals(getLogSelectionModel().getCurrentLogModel().getLogLevel())) {
item.setFont(item.getFont().deriveFont(Font.BOLD));
}
}
add(item);
}
}
示例3: NavigationEvaluationTask
import java.util.logging.Level; //導入方法依賴的package包/類
/**
* Default constructor.
*
* @param navigation
* @param pathPlanner
* @param mapName
* @param onlyRelevantPaths
* @param limit
* @param resultBasePath
* @param recordType
* @param level
*/
public NavigationEvaluationTask(String navigation, String pathPlanner, String mapName, boolean onlyRelevantPaths, int limit, String resultBasePath, RecordType recordType, Level level) {
super(BotNavigationParameters.class, NavigationEvaluatingBot.class);
this.navigation = navigation;
this.pathPlanner = pathPlanner;
this.mapName = mapName;
this.onlyRelevantPaths = onlyRelevantPaths;
this.limit = limit;
this.recordType = recordType;
this.stringLevel = level.getName();
this.resultBasePath = resultBasePath;
}
示例4: levelName
import java.util.logging.Level; //導入方法依賴的package包/類
private static String levelName(Level level) {
if(level == Level.WARNING) {
return "WARN";
} else if(level == null) {
return "parent";
} else {
return level.getName();
}
}