Package org.refcodes.logger
Enum LogPriority
- java.lang.Object
-
- java.lang.Enum<LogPriority>
-
- org.refcodes.logger.LogPriority
-
public enum LogPriority extends java.lang.Enum<LogPriority>
This enumeration defines the various log priorities to be used by the application logger. Them log priorities are inspired by common loggers such a slog4jand the Syslog priorities. Them priorities have the following meaning as of "http://en.wikipedia.org/wiki/Syslog":
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALERT
"Should be corrected immediately, therefore notify staff who can fix the problem.CRITICAL
"Should be corrected immediately, but indicates failure in a secondary system, an example is a loss of a backup ISP connection."DEBUG
"Info useful to developers for debugging the application, not useful during operations."DISCARD
Log is deactivated.ERROR
"Non-urgent failures, these should be relayed to developers or admins; each item must be resolved within a given time."INFO
"Additional information which might be useful for some stability period."NONE
No priority (has been set yet).NOTICE
"Events that are unusual but not error conditions - might be summarized in an email to developers or admins to spot potential problems - no immediate action required."PANIC
"A "panic" condition usually affecting multiple apps/servers/sites.TRACE
"Info useful to developers for debugging the application, not useful during operations."WARN
"Warning messages, not an error, but indication that an error will occur if action is not taken, e.g. file system 85% full - each item must be resolved within a given time."
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getLogLevel()
The Log-Level is the String representation of theLogPriority
, as required by theRuntimeLoggerImpl.setLogLevel(String)
.int
getPriority()
Returns the severity of the log priority.static LogPriority
toProprtiry(java.lang.String aPriorityName)
Determines the priority from the given name, ignoring the case.static LogPriority
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static LogPriority[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
PANIC
public static final LogPriority PANIC
"A "panic" condition usually affecting multiple apps/servers/sites. At this level it would usually notify all tech staff on call." ( See also http://en.wikipedia.org/wiki/Syslog
-
ALERT
public static final LogPriority ALERT
"Should be corrected immediately, therefore notify staff who can fix the problem. An example would be the loss of a primary ISP connection." See also http://en.wikipedia.org/wiki/Syslog
-
CRITICAL
public static final LogPriority CRITICAL
"Should be corrected immediately, but indicates failure in a secondary system, an example is a loss of a backup ISP connection." See also http://en.wikipedia.org/wiki/Syslog
-
ERROR
public static final LogPriority ERROR
"Non-urgent failures, these should be relayed to developers or admins; each item must be resolved within a given time." See also http://en.wikipedia.org/wiki/Syslog
-
WARN
public static final LogPriority WARN
"Warning messages, not an error, but indication that an error will occur if action is not taken, e.g. file system 85% full - each item must be resolved within a given time." See also http://en.wikipedia.org/wiki/Syslog
-
NOTICE
public static final LogPriority NOTICE
"Events that are unusual but not error conditions - might be summarized in an email to developers or admins to spot potential problems - no immediate action required." See also http://en.wikipedia.org/wiki/Syslog
-
INFO
public static final LogPriority INFO
"Additional information which might be useful for some stability period." See also http://en.wikipedia.org/wiki/Syslog
-
DEBUG
public static final LogPriority DEBUG
"Info useful to developers for debugging the application, not useful during operations." See also http://en.wikipedia.org/wiki/Syslog
-
TRACE
public static final LogPriority TRACE
"Info useful to developers for debugging the application, not useful during operations." See also http://en.wikipedia.org/wiki/Syslog TRACE provides even more comments for the developer when debugging.
-
DISCARD
public static final LogPriority DISCARD
Log is deactivated.
-
NONE
public static final LogPriority NONE
No priority (has been set yet).
-
-
Method Detail
-
values
public static LogPriority[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (LogPriority c : LogPriority.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static LogPriority valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getPriority
public int getPriority()
Returns the severity of the log priority.- Returns:
- aSeverity The severity of a log priority, the smaller, the less severe, the higher, the more severe.
-
getLogLevel
public java.lang.String getLogLevel()
The Log-Level is the String representation of theLogPriority
, as required by theRuntimeLoggerImpl.setLogLevel(String)
.- Returns:
- The String representation of the
LogPriority
.
-
toProprtiry
public static LogPriority toProprtiry(java.lang.String aPriorityName)
Determines the priority from the given name, ignoring the case.- Parameters:
aPriorityName
- The for which to retrieve the priority.- Returns:
- The according
LogPriority
or null if none was determinable.
-
-