本文整理汇总了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();
}
}