Package org.apache.log4j
Class Priority
java.lang.Object
org.apache.log4j.Priority
- Direct Known Subclasses:
Level
Refrain from using this class directly, use
the
Level
class instead.- Author:
- Ceki Gülcü
-
Field Summary
Modifier and TypeFieldDescriptionstatic int
static Priority
Deprecated.static int
static Priority
Deprecated.UseLevel.ERROR
instead.static int
static Priority
Deprecated.UseLevel.FATAL
instead.static int
static Priority
Deprecated.UseLevel.INFO
instead.static int
static int
static Priority
Deprecated.UseLevel.WARN
instead.static int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Two priorities are equal if their level fields are equal.static Priority[]
Deprecated.This method will be removed with no replacement.int
Return the syslog equivalent of this priority as an integer.boolean
Returnstrue
if this level has a higher or equal level than the level passed as argument,false
otherwise.int
toInt()
Returns the integer representation of this level.static Priority
toPriority(int val)
Deprecated.Please use theLevel.toLevel(int)
method instead.static Priority
toPriority(int val, Priority defaultPriority)
Deprecated.Please use theLevel.toLevel(int, Level)
method instead.static Priority
toPriority(String sArg)
Deprecated.Please use theLevel.toLevel(String)
method instead.static Priority
toPriority(String sArg, Priority defaultPriority)
Deprecated.Please use theLevel.toLevel(String, Level)
method instead.toString()
Returns the string representation of this priority.
-
Field Details
-
OFF_INT
public static final int OFF_INT- See Also:
- Constant Field Values
-
FATAL_INT
public static final int FATAL_INT- See Also:
- Constant Field Values
-
ERROR_INT
public static final int ERROR_INT- See Also:
- Constant Field Values
-
WARN_INT
public static final int WARN_INT- See Also:
- Constant Field Values
-
INFO_INT
public static final int INFO_INT- See Also:
- Constant Field Values
-
DEBUG_INT
public static final int DEBUG_INT- See Also:
- Constant Field Values
-
ALL_INT
public static final int ALL_INT- See Also:
- Constant Field Values
-
FATAL
Deprecated.UseLevel.FATAL
instead. -
ERROR
Deprecated.UseLevel.ERROR
instead. -
WARN
Deprecated.UseLevel.WARN
instead. -
INFO
Deprecated.UseLevel.INFO
instead. -
DEBUG
Deprecated.UseLevel.DEBUG
instead.
-
-
Constructor Details
-
Priority
protected Priority()Default constructor for deserialization. -
Priority
Instantiate a level object.- Parameters:
level
- a level as in intlevelStr
- a levelStrsyslogEquivalent
- the syslog equivalent level integer
-
-
Method Details
-
equals
Two priorities are equal if their level fields are equal. -
getSyslogEquivalent
public final int getSyslogEquivalent()Return the syslog equivalent of this priority as an integer.- Returns:
- the Syslog Equivalent of this Priority
-
isGreaterOrEqual
Returnstrue
if this level has a higher or equal level than the level passed as argument,false
otherwise.You should think twice before overriding the default implementation of
isGreaterOrEqual
method.- Parameters:
r
- a priority- Returns:
- a boolean
-
getAllPossiblePriorities
Deprecated.This method will be removed with no replacement.Return all possible priorities as an array of Level objects in descending order.- Returns:
- array of all possible priorities
-
toString
Returns the string representation of this priority. -
toInt
public final int toInt()Returns the integer representation of this level.- Returns:
- integer representation of this level
-
toPriority
Deprecated.Please use theLevel.toLevel(String)
method instead.- Parameters:
sArg
- a string to convert to a Priority- Returns:
- the corresponding Priority
-
toPriority
Deprecated.Please use theLevel.toLevel(int)
method instead.- Parameters:
val
- an integer to convert to a Priority- Returns:
- the corresponding Priority
-
toPriority
Deprecated.Please use theLevel.toLevel(int, Level)
method instead.- Parameters:
val
- an integer valuedefaultPriority
- a default priority value- Returns:
- correspoding Priority value
-
toPriority
Deprecated.Please use theLevel.toLevel(String, Level)
method instead.- Parameters:
sArg
- string valuedefaultPriority
- a default Priority- Returns:
- a Priority
-
Level.DEBUG
instead.