Enum Class LogPriority

java.lang.Object
java.lang.Enum<LogPriority>
org.refcodes.logger.LogPriority
All Implemented Interfaces:
Serializable, Comparable<LogPriority>, Constable

public enum LogPriority extends 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":
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    "Should be corrected immediately, therefore notify staff who can fix the problem.
    "Should be corrected immediately, but indicates failure in a secondary system, an example is a loss of a backup ISP connection."
    "Info useful to developers for debugging the application, not useful during operations."
    Log is deactivated.
    "Non-urgent failures, these should be relayed to developers or admins; each item must be resolved within a given time."
    "Additional information which might be useful for some stability period."
    No priority (has been set yet).
    "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."
    "A "panic" condition usually affecting multiple apps/servers/sites.
    "Info useful to developers for debugging the application, not useful during operations."
    "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

    Modifier and Type
    Method
    Description
    fromLevel(Level aLevel)
    Translates (as good as it gets) a JUL Level to a LogPriority.
    The Log-Level is the String representation of the LogPriority, as required by the RuntimeLoggerImpl.setLogLevel(String).
    int
    Returns the severity of the log priority.
    Translates (as good as it gets) a LogPriority to a JUL Level.
    toProprtiry(String aPriorityName)
    Determines the priority from the given name, ignoring the case.
    Returns the enum constant of this class with the specified name.
    static LogPriority[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • 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 Details

    • values

      public static LogPriority[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static LogPriority valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      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 String getLogLevel()
      The Log-Level is the String representation of the LogPriority, as required by the RuntimeLoggerImpl.setLogLevel(String).
      Returns:
      The String representation of the LogPriority.
    • toProprtiry

      public static LogPriority toProprtiry(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.
    • fromLevel

      public static LogPriority fromLevel(Level aLevel)
      Translates (as good as it gets) a JUL Level to a LogPriority.
      Parameters:
      aLevel - The JUL Level to be translated.
      Returns:
      The according LogPriority.
    • toLevel

      public Level toLevel()
      Translates (as good as it gets) a LogPriority to a JUL Level.
      Returns:
      The according Level.