public final class Level extends Object implements Comparable<Level>, Serializable
ALL
, is guaranteed to capture all levels when used in logging configurations.Modifier and Type | Field and Description |
---|---|
static Level |
ALL
All events should be logged.
|
static Level |
DEBUG
A general debugging event.
|
static Level |
ERROR
An error in the application, possibly recoverable.
|
static Level |
FATAL
A severe error that will prevent the application from continuing.
|
static Level |
INFO
An event for informational purposes.
|
static Level |
OFF
No events will be logged.
|
static Level |
TRACE
A fine-grained debug message, typically capturing the flow through the application.
|
static Level |
WARN
An event that might possible lead to an error.
|
Modifier and Type | Method and Description |
---|---|
Level |
clone() |
int |
compareTo(Level other) |
boolean |
equals(Object other) |
static Level |
forName(String name,
int intValue)
Retrieves an existing Level or creates on if it didn't previously exist.
|
Class<Level> |
getDeclaringClass() |
static Level |
getLevel(String name)
Return the Level assoicated with the name or null if the Level cannot be found.
|
StandardLevel |
getStandardLevel() |
int |
hashCode() |
int |
intLevel() |
boolean |
isAtLeastAsSpecificAs(int level)
Compares this level against the level passed as an argument and returns true if this
level is the same or more specific.
|
boolean |
isAtLeastAsSpecificAs(Level level)
Compares this level against the level passed as an argument and returns true if this
level is the same or more specific.
|
boolean |
lessOrEqual(int level)
Compares the specified Level against this one.
|
boolean |
lessOrEqual(Level level)
Compares the specified Level against this one.
|
String |
name() |
protected Object |
readResolve() |
static Level |
toLevel(String sArg)
Converts the string passed as argument to a level.
|
static Level |
toLevel(String name,
Level defaultLevel)
Converts the string passed as argument to a level.
|
String |
toString() |
static <T extends Enum<T>> |
valueOf(Class<T> enumType,
String name) |
static Level |
valueOf(String name)
Return the Level associated with the name.
|
static Level[] |
values()
Return an array of all the Levels that have been registered.
|
public static final Level OFF
public static final Level FATAL
public static final Level ERROR
public static final Level WARN
public static final Level INFO
public static final Level DEBUG
public static final Level TRACE
public static final Level ALL
public int intLevel()
public StandardLevel getStandardLevel()
public boolean isAtLeastAsSpecificAs(Level level)
level
- The level to check.public boolean isAtLeastAsSpecificAs(int level)
level
- The level to check.public boolean lessOrEqual(Level level)
level
- The level to check.public boolean lessOrEqual(int level)
level
- The level to check.public Level clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public int compareTo(Level other)
compareTo
in interface Comparable<Level>
public String name()
public static Level forName(String name, int intValue)
name
- The name of the level.intValue
- The integer value for the Level. If the level was previously created this value is ignored.IllegalArgumentException
- if the name is null or intValue is less than zero.public static Level getLevel(String name)
name
- The name of the Level.public static Level toLevel(String sArg)
DEBUG
.sArg
- The name of the desired Level.public static Level toLevel(String name, Level defaultLevel)
defaultLevel
.name
- The name of the desired Level.defaultLevel
- The Level to use if the String is invalid.public static Level[] values()
public static Level valueOf(String name)
name
- The name of the Level to return.IllegalArgumentException
- if the Level name is not registered.protected Object readResolve()
Copyright © 1999-2014 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.