當前位置: 首頁>>代碼示例>>Java>>正文


Java Level.getName方法代碼示例

本文整理匯總了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;
    }
}
 
開發者ID:VoxelGamesLib,項目名稱:VoxelGamesLibv2,代碼行數:22,代碼來源:ForwardHandler.java

示例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);
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:33,代碼來源:LogViewer.java

示例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;
}
 
開發者ID:kefik,項目名稱:Pogamut3,代碼行數:25,代碼來源:NavigationEvaluationTask.java

示例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();
    }
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:10,代碼來源:LoggingCommands.java


注:本文中的java.util.logging.Level.getName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。