Holger's
Java API

com.antelmann.util.logging
Class Level

java.lang.Object
  extended by com.antelmann.util.logging.Level
All Implemented Interfaces:
Serializable, Comparable<Level>
Direct Known Subclasses:
DBAccessLoggerLevel

public class Level
extends Object
implements Serializable, Comparable<Level>

Level classifies the logging of LogEntry objects. The implementation is inspired by java.util.logging, but simpler.

Author:
Holger Antelmann
See Also:
LogEntry, Logger, Serialized Form

Field Summary
static Level ALERT
           
static Level BEGIN
           
static Level COMMENT
           
static Level CONFIG
           
static Level DEBUG
           
static Level DEFAULT
          used when no other level was given; corresponds to NORMAL
static Level END
           
static Level ERROR
           
static Level EXCEPTION
           
static Level FAILURE
           
static Level FINE
           
static Level FINER
           
static Level FINEST
           
static Level IMPORTANT
           
static Level INFO
           
static Level NORMAL
           
static Level SEVERE
           
static Level SUCCESS
           
static Level WARNING
           
 
Constructor Summary
protected Level(String text, int compareValue)
           
 
Method Summary
 int compareTo(Level l)
          provides a simple way to order Levels by their assumed importance.
 boolean equals(Object obj)
           
static Level forName(String name)
          returns the level corresponding to the given name.
 int getImportance()
          returns the value the natural order is based on
static Level[] getKnownLevels()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT

public static final Level DEFAULT
used when no other level was given; corresponds to NORMAL


NORMAL

public static final Level NORMAL

CONFIG

public static final Level CONFIG

BEGIN

public static final Level BEGIN

END

public static final Level END

SUCCESS

public static final Level SUCCESS

FAILURE

public static final Level FAILURE

DEBUG

public static final Level DEBUG

EXCEPTION

public static final Level EXCEPTION

FINE

public static final Level FINE

FINER

public static final Level FINER

FINEST

public static final Level FINEST

INFO

public static final Level INFO

ERROR

public static final Level ERROR

SEVERE

public static final Level SEVERE

WARNING

public static final Level WARNING

IMPORTANT

public static final Level IMPORTANT

COMMENT

public static final Level COMMENT

ALERT

public static final Level ALERT
Constructor Detail

Level

protected Level(String text,
                int compareValue)
Parameters:
text - must not be null
Method Detail

getKnownLevels

public static Level[] getKnownLevels()

forName

public static Level forName(String name)
returns the level corresponding to the given name. If the level is not known, a level named 'Special Level (name)' is returned.


getImportance

public int getImportance()
returns the value the natural order is based on


compareTo

public int compareTo(Level l)
provides a simple way to order Levels by their assumed importance.

Specified by:
compareTo in interface Comparable<Level>

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads