当前位置: 首页>>代码示例>>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;未经允许,请勿转载。