Java Code Examples for java.util.logging.Level.getName()

The following are Jave code examples for showing how to use getName() of the java.util.logging.Level class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: VoxelGamesLibv2   File: ForwardHandler.java   View Source Code Vote up 6 votes
@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;
    }
}
 
Example 2
Project: rapidminer   File: LogViewer.java   View Source Code Vote up 5 votes
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);
	}
}
 
Example 3
Project: Pogamut3   File: NavigationEvaluationTask.java   View Source Code Vote up 5 votes
/**
 * 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;
}
 
Example 4
Project: ProjectAres   File: LoggingCommands.java   View Source Code Vote up 5 votes
private static String levelName(Level level) {
    if(level == Level.WARNING) {
        return "WARN";
    } else if(level == null) {
        return "parent";
    } else {
        return level.getName();
    }
}