View Javadoc

1   package org.naftulin.logwrapper;
2   
3   import java.util.logging.Level;
4   /***
5    * Supports log4j and standard java logging levels
6    * Since this package has to be stand alone I have to support both log4j,
7    * since it's used on majority of the projects I've worked on and java 
8    * standard logging if log4j is not present.
9    * Follows GOF singelton pattern.
10   *  
11   * @author henry naftulin
12   * @version 1.0
13   */
14  public class LogLevelAdaptor {
15  	public static final LogLevelAdaptor DEBUG = new LogLevelAdaptor(Level.FINEST);
16  	public static final LogLevelAdaptor INFO = new LogLevelAdaptor(Level.INFO);
17  	public static final LogLevelAdaptor WARN = new LogLevelAdaptor(Level.WARNING);
18  	public static final LogLevelAdaptor ERROR = new LogLevelAdaptor(Level.SEVERE);
19  	
20  	private final Level level;
21  	private LogLevelAdaptor(Level level) {
22  		this.level = level;
23  	}
24  	
25  	Level getLevel() { return level; }
26  }