Class Severity

  • All Implemented Interfaces:
    java.io.Serializable

    public final class Severity
    extends java.util.logging.Level
    syslog(3C) severity levels defined in sys/syslog.h.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getNative()
      Returns the native syslog(3C) severity.
      static Severity getSeverityWithName​(java.lang.String name)
      Returns the Severity object with the given name, interpreted case-insensitively.
      static java.util.logging.Level parse​(java.lang.String name)
      Returns the Severity object with the given name, interpreted case-insensitively.
      static Severity severityForLevel​(java.util.logging.Level l)
      Returns the Severity closest in meaning to the given Level.
      • Methods inherited from class java.util.logging.Level

        equals, getLocalizedName, getName, getResourceBundleName, hashCode, intValue, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • EMERG

        public static final Severity EMERG
        LOG_EMERG
      • ALERT

        public static final Severity ALERT
        LOG_ALERT
      • CRIT

        public static final Severity CRIT
        LOG_CRIT
      • ERR

        public static final Severity ERR
        LOG_ERR
      • WARNING

        public static final Severity WARNING
        LOG_WARNING
      • NOTICE

        public static final Severity NOTICE
        LOG_NOTICE
      • INFO

        public static final Severity INFO
        LOG_INFO
      • DEBUG

        public static final Severity DEBUG
        LOG_DEBUG
    • Method Detail

      • severityForLevel

        public static Severity severityForLevel​(java.util.logging.Level l)
        Returns the Severity closest in meaning to the given Level. This is meant to be used by SyslogHandler to determine a proper Severity for Records which only specify a Level.
        • Level.SEVERE or higher becomes Severity.ERR
        • Level.WARNING becomes Severity.WARNING
        • Level.INFO becomes Severity.INFO
        • Level.FINE becomes Severity.DEBUG
        If the level is below Level.FINE, i.e. the level is too low for syslog, then null is returned.
      • getNative

        public int getNative()
        Returns the native syslog(3C) severity.
      • parse

        public static java.util.logging.Level parse​(java.lang.String name)
        Returns the Severity object with the given name, interpreted case-insensitively.
        Throws:
        java.lang.IllegalArgumentException - if the name isn't of a known severity.
      • getSeverityWithName

        public static Severity getSeverityWithName​(java.lang.String name)
        Returns the Severity object with the given name, interpreted case-insensitively.
        Throws:
        java.lang.IllegalArgumentException - if the name isn't of a known severity.