org.apache.log4j
Class Priority

java.lang.Object
  extended by org.apache.log4j.Priority
Direct Known Subclasses:
Level

public class Priority
extends Object

Refrain from using this class directly, use the Level class instead.


Field Summary
static int ALL_INT
          The ALL has the lowest possible rank and is intended to turn on all logging.
static Priority DEBUG
          Deprecated. Use Level.DEBUG instead.
static int DEBUG_INT
          The DEBUG Level designates fine-grained informational events that are most useful to debug an application.
static Priority ERROR
          Deprecated. Use Level.ERROR instead.
static int ERROR_INT
          The ERROR level designates error events that might still allow the application to continue running.
static Priority FATAL
          Deprecated. Use Level.FATAL instead.
static int FATAL_INT
          The FATAL level designates very severe error events that will presumably lead the application to abort.
static Priority INFO
          Deprecated. Use Level.INFO instead.
static int INFO_INT
          The INFO level designates informational messages that highlight the progress of the application at coarse-grained level.
static int OFF_INT
          The OFF has the highest possible rank and is intended to turn off logging.
static Priority WARN
          Deprecated. Use Level.WARN instead.
static int WARN_INT
          The WARN level designates potentially harmful situations.
 
Constructor Summary
protected Priority()
          Default constructor for deserialization.
protected Priority(int level, String levelStr, int syslogEquivalent)
          Instantiate a level object.
 
Method Summary
 boolean equals(Object o)
          Two priorities are equal if their level fields are equal.
static Priority[] getAllPossiblePriorities()
          Deprecated. This method will be removed with no replacement.
 int getSyslogEquivalent()
          Returns the syslog equivalent of this priority as an integer.
 int hashCode()
           
 boolean isGreaterOrEqual(Priority r)
          Returns true 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 the Level.toLevel(int) method instead.
static Priority toPriority(int val, Priority defaultPriority)
          Deprecated. Please use the Level.toLevel(int, Level) method instead.
static Priority toPriority(String sArg)
          Deprecated. Please use the Level.toLevel(String) method instead.
static Priority toPriority(String sArg, Priority defaultPriority)
          Deprecated. Please use the Level.toLevel(String, Level) method instead.
 String toString()
          Returns the string representation of this priority.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

OFF_INT

public static final int OFF_INT
The OFF has the highest possible rank and is intended to turn off logging.

See Also:
Constant Field Values

FATAL_INT

public static final int FATAL_INT
The FATAL level 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
The ERROR level 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
The WARN level designates potentially harmful situations.

See Also:
Constant Field Values

INFO_INT

public static final int INFO_INT
The INFO level 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
The DEBUG Level 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
The ALL has 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. Use Level.FATAL instead.

ERROR

@Deprecated
public static final Priority ERROR
Deprecated. Use Level.ERROR instead.

WARN

@Deprecated
public static final Priority WARN
Deprecated. Use Level.WARN instead.

INFO

@Deprecated
public static final Priority INFO
Deprecated. Use Level.INFO instead.

DEBUG

@Deprecated
public static final Priority DEBUG
Deprecated. Use Level.DEBUG instead.
Constructor Detail

Priority

protected Priority()
Default constructor for deserialization.


Priority

protected Priority(int level,
                   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(Object o)
Two priorities are equal if their level fields are equal.

Overrides:
equals in class Object
Parameters:
o - The Object to check.
Returns:
true if the objects are equal, false otherwise.
Since:
1.2

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getSyslogEquivalent

public final int getSyslogEquivalent()
Returns the syslog equivalent of this priority as an integer.

Returns:
The equivalent syslog value.

isGreaterOrEqual

public boolean isGreaterOrEqual(Priority r)
Returns true 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 - 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 String toString()
Returns the string representation of this priority.

Overrides:
toString in class 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(String sArg)
Deprecated. Please use the Level.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 the Level.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 the Level.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(String sArg,
                                             Priority defaultPriority)
Deprecated. Please use the Level.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.


Copyright © 1999-2014 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.