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.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intTheALLhas the lowest possible rank and is intended to turn on all logging.static final PriorityDeprecated.static final intTheDEBUGLevel designates fine-grained informational events that are most useful to debug an application.static final PriorityDeprecated.UseLevel.ERRORinstead.static final intTheERRORlevel designates error events that might still allow the application to continue running.static final PriorityDeprecated.UseLevel.FATALinstead.static final intTheFATALlevel designates very severe error events that will presumably lead the application to abort.static final PriorityDeprecated.UseLevel.INFOinstead.static final intTheINFOlevel designates informational messages that highlight the progress of the application at coarse-grained level.(package private) int(package private) Stringstatic final intTheOFFhas the highest possible rank and is intended to turn off logging.(package private) intstatic final PriorityDeprecated.UseLevel.WARNinstead.static final intTheWARNlevel designates potentially harmful situations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTwo priorities are equal if their level fields are equal.static Priority[]Deprecated.This method will be removed with no replacement.final intReturns the syslog equivalent of this priority as an integer.inthashCode()booleanReturnstrueif this level has a higher or equal level than the level passed as argument,falseotherwise.final 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(String sArg) Deprecated.Please use theLevel.toLevel(String)method instead.static PrioritytoPriority(String sArg, Priority defaultPriority) Deprecated.Please use theLevel.toLevel(String, Level)method instead.final StringtoString()Returns the string representation of this priority.
-
Field Details
-
OFF_INT
public static final int OFF_INTTheOFFhas the highest possible rank and is intended to turn off logging.- See Also:
-
FATAL_INT
public static final int FATAL_INTTheFATALlevel designates very severe error events that will presumably lead the application to abort.- See Also:
-
ERROR_INT
public static final int ERROR_INTTheERRORlevel designates error events that might still allow the application to continue running.- See Also:
-
WARN_INT
public static final int WARN_INTTheWARNlevel designates potentially harmful situations.- See Also:
-
INFO_INT
public static final int INFO_INTTheINFOlevel designates informational messages that highlight the progress of the application at coarse-grained level.- See Also:
-
DEBUG_INT
public static final int DEBUG_INTTheDEBUGLevel designates fine-grained informational events that are most useful to debug an application.- See Also:
-
ALL_INT
public static final int ALL_INTTheALLhas the lowest possible rank and is intended to turn on all logging.- See Also:
-
FATAL
Deprecated.UseLevel.FATALinstead. -
ERROR
Deprecated.UseLevel.ERRORinstead. -
WARN
Deprecated.UseLevel.WARNinstead. -
INFO
Deprecated.UseLevel.INFOinstead. -
DEBUG
Deprecated.UseLevel.DEBUGinstead. -
level
transient int level -
levelStr
-
syslogEquivalent
transient int syslogEquivalent
-
-
Constructor Details
-
Priority
protected Priority()Default constructor for deserialization. -
Priority
Instantiate a level object.- Parameters:
level- The level value.levelStr- The level name.syslogEquivalent- The equivalent syslog value.
-
-
Method Details
-
equals
Two priorities are equal if their level fields are equal. -
hashCode
public int hashCode() -
getSyslogEquivalent
public final int getSyslogEquivalent()Returns the syslog equivalent of this priority as an integer.- Returns:
- The equivalent syslog value.
-
isGreaterOrEqual
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.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
Returns the string representation of this priority. -
toInt
public final int toInt()Returns the integer representation of this level.- Returns:
- The integer value of this level.
-
toPriority
Deprecated.Please use theLevel.toLevel(String)method instead.- Parameters:
sArg- The name of the Priority.- Returns:
- The Priority matching the name.
-
toPriority
Deprecated.Please use theLevel.toLevel(int)method instead.- Parameters:
val- The value of the Priority.- Returns:
- The Priority matching the value.
-
toPriority
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.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.
-
Level.DEBUGinstead.