Package org.apache.log4j
Class Priority
- java.lang.Object
-
- org.apache.log4j.Priority
-
-
Field Summary
Fields Modifier and Type Field Description static intALL_INTTheALLhas the lowest possible rank and is intended to turn on all logging.static PriorityDEBUGDeprecated.UseLevel.DEBUGinstead.static intDEBUG_INTTheDEBUGLevel designates fine-grained informational events that are most useful to debug an application.static PriorityERRORDeprecated.UseLevel.ERRORinstead.static intERROR_INTTheERRORlevel designates error events that might still allow the application to continue running.static PriorityFATALDeprecated.UseLevel.FATALinstead.static intFATAL_INTTheFATALlevel designates very severe error events that will presumably lead the application to abort.static PriorityINFODeprecated.UseLevel.INFOinstead.static intINFO_INTTheINFOlevel designates informational messages that highlight the progress of the application at coarse-grained level.(package private) intlevel(package private) java.lang.StringlevelStrstatic intOFF_INTTheOFFhas the highest possible rank and is intended to turn off logging.(package private) intsyslogEquivalent(package private) Levelversion2Levelstatic PriorityWARNDeprecated.UseLevel.WARNinstead.static intWARN_INTTheWARNlevel designates potentially harmful situations.
-
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()Returns the syslog equivalent of this priority as an integer.LevelgetVersion2Level()Gets the Log4j 2.x level associated with this priorityinthashCode()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
TheOFFhas the highest possible rank and is intended to turn off logging.- See Also:
- Constant Field Values
-
FATAL_INT
public static final int FATAL_INT
TheFATALlevel designates very severe error events that will presumably lead the application to abort.- See Also:
- Constant Field Values
-
ERROR_INT
public static final int ERROR_INT
TheERRORlevel designates error events that might still allow the application to continue running.- See Also:
- Constant Field Values
-
WARN_INT
public static final int WARN_INT
TheWARNlevel designates potentially harmful situations.- See Also:
- Constant Field Values
-
INFO_INT
public static final int INFO_INT
TheINFOlevel designates informational messages that highlight the progress of the application at coarse-grained level.- See Also:
- Constant Field Values
-
DEBUG_INT
public static final int DEBUG_INT
TheDEBUGLevel designates fine-grained informational events that are most useful to debug an application.- See Also:
- Constant Field Values
-
ALL_INT
public static final int ALL_INT
TheALLhas the lowest possible rank and is intended to turn on all logging.- See Also:
- Constant Field Values
-
FATAL
@Deprecated 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.
-
level
transient int level
-
levelStr
transient java.lang.String levelStr
-
syslogEquivalent
transient int syslogEquivalent
-
version2Level
transient Level version2Level
-
-
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- The level value.levelStr- The level name.syslogEquivalent- The equivalent syslog value.
-
-
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- Parameters:
o- The Object to check.- Returns:
- true if the objects are equal, false otherwise.
- Since:
- 1.2
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getSyslogEquivalent
public final int getSyslogEquivalent()
Returns the syslog equivalent of this priority as an integer.- Returns:
- The equivalent syslog value.
-
getVersion2Level
public Level getVersion2Level()
Gets the Log4j 2.x level associated with this priority- Returns:
- a Log4j 2.x level.
-
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- The Priority to check.- Returns:
- true if the current level is greater or equal to the specified Priority.
-
getAllPossiblePriorities
@Deprecated public static Priority[] getAllPossiblePriorities()
Deprecated.This method will be removed with no replacement.Returns all possible priorities as an array of Level objects in descending order.- Returns:
- An array of all possible Priorities.
-
toString
public final java.lang.String toString()
Returns the string representation of this priority.- Overrides:
toStringin classjava.lang.Object- Returns:
- The name of the Priority.
-
toInt
public final int toInt()
Returns the integer representation of this level.- Returns:
- The integer value of this level.
-
toPriority
@Deprecated public static Priority toPriority(java.lang.String sArg)
Deprecated.Please use theLevel.toLevel(String)method instead.- Parameters:
sArg- The name of the Priority.- Returns:
- The Priority matching the name.
-
toPriority
@Deprecated public static Priority toPriority(int val)
Deprecated.Please use theLevel.toLevel(int)method instead.- Parameters:
val- The value of the Priority.- Returns:
- The Priority matching the value.
-
toPriority
@Deprecated public static Priority toPriority(int val, Priority defaultPriority)
Deprecated.Please use theLevel.toLevel(int, Level)method instead.- Parameters:
val- The value of the Priority.defaultPriority- The default Priority to use if the value is invalid.- Returns:
- The Priority matching the value or the default Priority if no match is found.
-
toPriority
@Deprecated public static Priority toPriority(java.lang.String sArg, Priority defaultPriority)
Deprecated.Please use theLevel.toLevel(String, Level)method instead.- Parameters:
sArg- The name of the Priority.defaultPriority- The default Priority to use if the name is not found.- Returns:
- The Priority matching the name or the default Priority if no match is found.
-
-