com.flat502.rox.log
Class Level

java.lang.Object
  extended by com.flat502.rox.log.Level

public class Level
extends java.lang.Object

Logging level constants.

See Also:
Log

Field Summary
static Level DEBUG
          Errors, warnings and informational and debug messages are logged.
static Level ERROR
          The least verbose logging level: only errors are logged.
static Level INFO
          Errors, warnings and informational messages are logged.
static Level TRACE
          The most verbose logging level: everything is logged.
static Level WARNING
          Errors and warnings are logged.
 
Method Summary
 boolean at(Level level)
          Compares a given level to determine whether or not this instance meets the indicated verbosity requirement.
static Level parseLevel(java.lang.String name, Level defaultLevel)
          A convenience method that converts a string name into a Level instance.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR

public static final Level ERROR
The least verbose logging level: only errors are logged.


WARNING

public static final Level WARNING
Errors and warnings are logged.


INFO

public static final Level INFO
Errors, warnings and informational messages are logged.


DEBUG

public static final Level DEBUG
Errors, warnings and informational and debug messages are logged.


TRACE

public static final Level TRACE
The most verbose logging level: everything is logged.

Method Detail

at

public boolean at(Level level)
Compares a given level to determine whether or not this instance meets the indicated verbosity requirement.

If the indicated level is less verbose than the level this instance indicates then this method will return true. The intention is to invoke this method on a configured level and pass it the level constant representing the severity of the message being logged.

Parameters:
level - The level to compare this instance's verbosity against.
Returns:
true if the verbosity of level is less than that of this instance.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

parseLevel

public static Level parseLevel(java.lang.String name,
                               Level defaultLevel)
A convenience method that converts a string name into a Level instance.

Names are case-insensitive and are named for the constant members of this class (so the string value trace is mapped to TRACE.

Parameters:
name - The name of the desired level.
defaultLevel - A level to return if the name is not matched.
Returns:
An appropriate Level instance, or the default value provided if the level is not supported.