Package org.apache.log4j
Class Priority
- java.lang.Object
-
- org.apache.log4j.Priority
-
-
Field Summary
Fields Modifier and Type Field Description static intALL_INTstatic PriorityDEBUGDeprecated.UseLevel.DEBUGinstead.static intDEBUG_INTstatic PriorityERRORDeprecated.UseLevel.ERRORinstead.static intERROR_INTstatic PriorityFATALDeprecated.UseLevel.FATALinstead.static intFATAL_INTstatic PriorityINFODeprecated.UseLevel.INFOinstead.static intINFO_INTstatic intOFF_INTstatic PriorityWARNDeprecated.UseLevel.WARNinstead.static intWARN_INT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Two priorities are equal if their level fields are equal.static Priority[]getAllPossiblePriorities()Deprecated.This method will be removed with no replacement.intgetSyslogEquivalent()Return the syslog equivalent of this priority as an integer.booleanisGreaterOrEqual(Priority r)Returnstrueif this level has a higher or equal level than the level passed as argument,falseotherwise.inttoInt()Returns the integer representation of this level.static PrioritytoPriority(int val)Deprecated.Please use theLevel.toLevel(int)method instead.static PrioritytoPriority(int val, Priority defaultPriority)Deprecated.Please use theLevel.toLevel(int, Level)method instead.static PrioritytoPriority(java.lang.String sArg)Deprecated.Please use theLevel.toLevel(String)method instead.static PrioritytoPriority(java.lang.String sArg, Priority defaultPriority)Deprecated.Please use theLevel.toLevel(String, Level)method instead.java.lang.StringtoString()Returns the string representation of this priority.
-
-
-
Field Detail
-
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
public static final Priority FATAL
Deprecated.UseLevel.FATALinstead.
-
ERROR
@Deprecated public static final Priority ERROR
Deprecated.UseLevel.ERRORinstead.
-
WARN
@Deprecated public static final Priority WARN
Deprecated.UseLevel.WARNinstead.
-
INFO
@Deprecated public static final Priority INFO
Deprecated.UseLevel.INFOinstead.
-
DEBUG
@Deprecated public static final Priority DEBUG
Deprecated.UseLevel.DEBUGinstead.
-
-
Constructor Detail
-
Priority
protected Priority()
Default constructor for deserialization.
-
Priority
protected Priority(int level, java.lang.String levelStr, int syslogEquivalent)
Instantiate a level object.- Parameters:
level- a level as in intlevelStr- a levelStrsyslogEquivalent- the syslog equivalent level integer
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
Two priorities are equal if their level fields are equal.- Overrides:
equalsin classjava.lang.Object- Since:
- 1.2
-
getSyslogEquivalent
public final int getSyslogEquivalent()
Return the syslog equivalent of this priority as an integer.- Returns:
- the Syslog Equivalent of this Priority
-
isGreaterOrEqual
public boolean isGreaterOrEqual(Priority r)
Returnstrueif this level has a higher or equal level than the level passed as argument,falseotherwise.You should think twice before overriding the default implementation of
isGreaterOrEqualmethod.- Parameters:
r- a priority- Returns:
- a boolean
-
getAllPossiblePriorities
@Deprecated public static Priority[] 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
public final java.lang.String toString()
Returns the string representation of this priority.- Overrides:
toStringin classjava.lang.Object
-
toInt
public final int toInt()
Returns the integer representation of this level.- Returns:
- integer representation of this level
-
toPriority
@Deprecated public static Priority toPriority(java.lang.String sArg)
Deprecated.Please use theLevel.toLevel(String)method instead.- Parameters:
sArg- a string to convert to a Priority- Returns:
- the corresponding Priority
-
toPriority
@Deprecated public static Priority toPriority(int val)
Deprecated.Please use theLevel.toLevel(int)method instead.- Parameters:
val- an integer to convert to a Priority- Returns:
- the corresponding Priority
-
toPriority
@Deprecated public static Priority toPriority(int val, Priority defaultPriority)
Deprecated.Please use theLevel.toLevel(int, Level)method instead.- Parameters:
val- an integer valuedefaultPriority- a default priority value- Returns:
- corresponding Priority value
-
toPriority
@Deprecated public static Priority toPriority(java.lang.String sArg, Priority defaultPriority)
Deprecated.Please use theLevel.toLevel(String, Level)method instead.- Parameters:
sArg- string valuedefaultPriority- a default Priority- Returns:
- a Priority
-
-