public final class Level extends Objectimplements Comparable <Level >, Serializable
OFF (most specific, no logging)FATAL (most specific, little data)ERRORWARNINFODEBUGTRACE (least specific, a lot of data)ALL (least specific, all data)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 String |
CATEGORY
|
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
|
boolean |
equals(Object
|
static Level |
forName(String
Retrieves an existing Level or creates on if it didn't previously exist.
|
Class |
getDeclaringClass()
|
static Level |
getLevel(String
Return the Level associated with the name or null if the Level cannot be found.
|
StandardLevel |
getStandardLevel()
Gets the standard Level values as an enum.
|
int |
hashCode()
|
int |
intLevel()
Gets the integral value of this Level.
|
boolean |
isInRange(Level
Compares this level against the levels passed as arguments and returns true if this level is in between the given levels.
|
boolean |
isLessSpecificThan(Level
Compares this level against the level passed as an argument and returns true if this level is the same or is less specific.
|
boolean |
isMoreSpecificThan(Level
Compares this level against the level passed as an argument and returns true if this level is the same or is more specific.
|
String |
name()
Gets the symbolic name of this Level.
|
protected Object |
readResolve()
|
static Level |
toLevel(String
Converts the string passed as argument to a level.
|
static Level |
toLevel(String
Converts the string passed as argument to a level.
|
String |
toString()
|
static <T extends Enum |
valueOf(Class
Returns the enum constant of the specified enum type with the specified name.
|
static Level |
valueOf(String
Return the Level associated with the name.
|
static Level |
values()
Return an array of all the Levels that have been registered.
|
public static final LevelOFF
public static final LevelFATAL
public static final LevelERROR
public static final LevelWARN
public static final LevelINFO
public static final LevelDEBUG
public static final LevelTRACE
public static final LevelALL
public static final StringCATEGORY
public int intLevel()
public StandardLevelgetStandardLevel()
public boolean isInRange(LevelminLevel, Level maxLevel)
minLevel - The minimum level to test.
maxLevel - The maximum level to test.
public boolean isLessSpecificThan(Levellevel)
level - The level to test.
public boolean isMoreSpecificThan(Levellevel)
level - The level to test.
public Levelclone() throws CloneNotSupportedException
clone in class
Object
CloneNotSupportedException
public int compareTo(Levelother)
public boolean equals(Objectother)
public int hashCode()
public Stringname()
toString().
public StringtoString()
public static LevelforName(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 LevelgetLevel(String name)
name - The name of the Level.
public static LeveltoLevel(String sArg)
DEBUG.
sArg - The name of the desired Level.
public static LeveltoLevel(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 LevelvalueOf(String name)
name - The name of the Level to return.
NullPointerException - if the Level name is
null.
IllegalArgumentException - if the Level name is not registered.
public static <T extends Enum<T>> T valueOf(Class <T> enumType, String name)
T - The enum type whose constant is to be returned
enumType - the
Class object of the enum type from which to return a constant
name - the name of the constant to return
IllegalArgumentException - if the specified enum type has no constant with the specified name, or the specified class object does not represent an enum type
NullPointerException - if
enumType or
name are
null
Enum.valueOf(Class, String)
protected ObjectreadResolve()