logahawk
Enum Severity

java.lang.Object
  extended by java.lang.Enum<Severity>
      extended by logahawk.Severity
All Implemented Interfaces:
Serializable, Comparable<Severity>

public enum Severity
extends Enum<Severity>

Defines all Severity levels for log messages. The severity levels are based loosely on the UNIX severity levels.


Enum Constant Summary
ALERT
          An important but non-error message.
DEBUG
          For developing and debugging purposes.
ERROR
          An error that is not fatal to the process but does need to be reported.
FATAL
          A fatal error that should halt the process (and possibly the program).
INFO
          The default severity, used for most messages.
PANIC
          The worst kind of error.
WARN
          A warning that a minor problem or recoverable problem has has occurred.
 
Method Summary
 String getFixedLengthString()
          Returns the enumerations value padded to the maximum size of any enumeration value.
 String getNormalCaseValue()
          Returns toString() with normal casing -- first letter uppercase, other letters lowercase.
 String toString()
           
static Severity valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Severity[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DEBUG

public static final Severity DEBUG
For developing and debugging purposes.


INFO

public static final Severity INFO
The default severity, used for most messages.


ALERT

public static final Severity ALERT
An important but non-error message. This is separate from info to disambiguate important messages that could be overlooked in a sea of info messages.


WARN

public static final Severity WARN
A warning that a minor problem or recoverable problem has has occurred. This may include problems that seem insignificant now but might (or might not) cause major problems later.


ERROR

public static final Severity ERROR
An error that is not fatal to the process but does need to be reported.


FATAL

public static final Severity FATAL
A fatal error that should halt the process (and possibly the program).


PANIC

public static final Severity PANIC
The worst kind of error. The program has encountered a completely unexpected error, one that requires immediate attention. This is usually reserved for errors like program corruption, hardware failures, etc. This severity exists because some larger systems may need to disambiguate between fatal errors to a process versus fatal errors for the entire system.

Method Detail

values

public static Severity[] 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 (Severity c : Severity.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Severity valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

toString

public String toString()
Overrides:
toString in class Enum<Severity>

getFixedLengthString

public String getFixedLengthString()
Returns the enumerations value padded to the maximum size of any enumeration value.


getNormalCaseValue

public String getNormalCaseValue()
Returns toString() with normal casing -- first letter uppercase, other letters lowercase.