org.apache.log4j.lf5

Class LogLevel

public class LogLevel extends Object implements Serializable

The LogLevel class defines a set of standard logging levels. The logging Level objects are ordered and are specified by ordered integers. Enabling logging at a given level also enables logging at all higher levels.

Author: Michael J. Sikorsky Robert Shaw Brent Sprecher Richard Hurst Brad Marlborough

Field Summary
static LogLevelCONFIG
static LogLevelDEBUG
static LogLevelERROR
static LogLevelFATAL
static LogLevelFINE
static LogLevelFINER
static LogLevelFINEST
static LogLevelINFO
static LogLevelSEVERE
static LogLevelWARN
static LogLevelWARNING
protected String_label
protected int_precedence
Constructor Summary
LogLevel(String label, int precedence)
Method Summary
booleanencompasses(LogLevel level)
Returns true if the level supplied is encompassed by this level.
booleanequals(Object o)
static ListgetAllDefaultLevels()
static ListgetJdk14Levels()
StringgetLabel()
Return the Label of the LogLevel.
static ListgetLog4JLevels()
static MapgetLogLevelColorMap()
protected intgetPrecedence()
inthashCode()
static LogLevelregister(LogLevel logLevel)
Registers a used defined LogLevel.
static voidregister(LogLevel[] logLevels)
static voidregister(List logLevels)
static voidresetLogLevelColorMap()
voidsetLogLevelColorMap(LogLevel level, Color color)
StringtoString()
static LogLevelvalueOf(String level)
Convert a log level label into a LogLevel object.

Field Detail

CONFIG

public static final LogLevel CONFIG

DEBUG

public static final LogLevel DEBUG

ERROR

public static final LogLevel ERROR

FATAL

public static final LogLevel FATAL

FINE

public static final LogLevel FINE

FINER

public static final LogLevel FINER

FINEST

public static final LogLevel FINEST

INFO

public static final LogLevel INFO

SEVERE

public static final LogLevel SEVERE

WARN

public static final LogLevel WARN

WARNING

public static final LogLevel WARNING

_label

protected String _label

_precedence

protected int _precedence

Constructor Detail

LogLevel

public LogLevel(String label, int precedence)

Method Detail

encompasses

public boolean encompasses(LogLevel level)
Returns true if the level supplied is encompassed by this level. For example, LogLevel.SEVERE encompasses no other LogLevels and LogLevel.FINE encompasses all other LogLevels. By definition, a LogLevel encompasses itself.

equals

public boolean equals(Object o)

getAllDefaultLevels

public static List getAllDefaultLevels()

getJdk14Levels

public static List getJdk14Levels()

getLabel

public String getLabel()
Return the Label of the LogLevel.

getLog4JLevels

public static List getLog4JLevels()

Returns: A List of LogLevel objects that map to log4j Priority objects.

getLogLevelColorMap

public static Map getLogLevelColorMap()

getPrecedence

protected int getPrecedence()

hashCode

public int hashCode()

register

public static LogLevel register(LogLevel logLevel)
Registers a used defined LogLevel.

Parameters: logLevel The log level to be registered. Cannot be a default LogLevel

Returns: LogLevel The replaced log level.

register

public static void register(LogLevel[] logLevels)

register

public static void register(List logLevels)

resetLogLevelColorMap

public static void resetLogLevelColorMap()

setLogLevelColorMap

public void setLogLevelColorMap(LogLevel level, Color color)

toString

public String toString()

valueOf

public static LogLevel valueOf(String level)
Convert a log level label into a LogLevel object.

Parameters: level The label of a level to be converted into a LogLevel.

Returns: LogLevel The LogLevel with a label equal to level.

Throws: LogLevelFormatException Is thrown when the level can not be converted into a LogLevel.

Copyright 2000-2005 Apache Software Foundation.