Skip to content

Instantly share code, notes, and snippets.

@jyeary
Created August 4, 2014 01:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jyeary/bcaa4f4ca01c42f77922 to your computer and use it in GitHub Desktop.
Save jyeary/bcaa4f4ca01c42f77922 to your computer and use it in GitHub Desktop.
Enum for java.util.logging.Level for use with java.util.logging.Logger
/*
* Copyright 2012-2014 John Yeary <jyeary@bluelotussoftware.com>.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.bluelotussoftware.logging;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* An enumeration of logging {@link Level} for {@link Logger}.
*
* @author John Yeary
* @version 1.0
*/
public enum LoggingLevel {
ALL(Level.ALL), CONFIG(Level.CONFIG), FINE(Level.FINE), FINER(Level.FINER),
FINEST(Level.FINEST), INFO(Level.INFO), OFF(Level.OFF), SEVERE(Level.SEVERE),
WARNING(Level.WARNING);
private final Level level;
/**
* Default constructor that sets the {@link Level}.
*
* @param level The logging {@link Level} to be set.
*/
private LoggingLevel(final Level level) {
this.level = level;
}
/**
* Gets the current logging {@link Level} for the enumerated type.
*
* @return The current logging {@link Level} for this enumeration.
*/
public Level getLevel() {
return level;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment