Class Level

  • All Implemented Interfaces:
    Serializable

    public class Level
    extends Object
    implements Serializable
    Level objects are used to indicate the level of logging. There are a set of predefined logging levels, each associated with an integer value. Enabling a certain logging level also enables all logging levels with larger values.

    The predefined levels in ascending order are FINEST, FINER, FINE, CONFIG, INFO, WARNING, SEVERE. There are two additional predefined levels, which are ALL and OFF. ALL indicates logging all messages, and OFF indicates logging no messages.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Level ALL
      The ALL level provides all logging messages.
      static Level CONFIG
      The CONFIG level provides static configuration messages.
      static Level FINE
      The FINE level provides tracing messages.
      static Level FINER
      The FINER level provides more detailed tracing messages.
      static Level FINEST
      The FINEST level provides highly detailed tracing messages.
      static Level INFO
      The INFO level provides informative messages.
      static Level OFF
      The OFF level provides no logging messages.
      static Level SEVERE
      The SEVERE level provides severe failure messages.
      static Level WARNING
      The WARNING level provides warnings.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Level​(String name, int level)
      Constructs an instance of Level taking the supplied name and level value.
      protected Level​(String name, int level, String resourceBundleName)
      Constructs an instance of Level taking the supplied name, level value and resource bundle name.
    • Field Detail

      • OFF

        public static final Level OFF
        The OFF level provides no logging messages.
      • SEVERE

        public static final Level SEVERE
        The SEVERE level provides severe failure messages.
      • WARNING

        public static final Level WARNING
        The WARNING level provides warnings.
      • INFO

        public static final Level INFO
        The INFO level provides informative messages.
      • CONFIG

        public static final Level CONFIG
        The CONFIG level provides static configuration messages.
      • FINE

        public static final Level FINE
        The FINE level provides tracing messages.
      • FINER

        public static final Level FINER
        The FINER level provides more detailed tracing messages.
      • FINEST

        public static final Level FINEST
        The FINEST level provides highly detailed tracing messages.
      • ALL

        public static final Level ALL
        The ALL level provides all logging messages.
    • Constructor Detail

      • Level

        protected Level​(String name,
                        int level)
        Constructs an instance of Level taking the supplied name and level value.
        Parameters:
        name - the name of the level.
        level - an integer value indicating the level.
        Throws:
        NullPointerException - if name is null.
      • Level

        protected Level​(String name,
                        int level,
                        String resourceBundleName)
        Constructs an instance of Level taking the supplied name, level value and resource bundle name.
        Parameters:
        name - the name of the level.
        level - an integer value indicating the level.
        resourceBundleName - the name of the resource bundle to use.
        Throws:
        NullPointerException - if name is null.
    • Method Detail

      • getName

        public String getName()
        Gets the name of this level.
        Returns:
        this level's name.
      • getResourceBundleName

        public String getResourceBundleName()
        Gets the name of the resource bundle associated with this level.
        Returns:
        the name of this level's resource bundle.
      • intValue

        public final int intValue()
        Gets the integer value indicating this level.
        Returns:
        this level's integer value.
      • getLocalizedName

        public String getLocalizedName()
        Gets the localized name of this level. The default locale is used. If no resource bundle is associated with this level then the original level name is returned.
        Returns:
        the localized name of this level.
      • equals

        public boolean equals​(Object o)
        Compares two Level objects for equality. They are considered to be equal if they have the same level value.
        Overrides:
        equals in class Object
        Parameters:
        o - the other object to compare this level to.
        Returns:
        true if this object equals to the supplied object, false otherwise.
        See Also:
        Object.hashCode()
      • toString

        public final String toString()
        Returns the string representation of this Level object. In this case, it is the level's name.
        Overrides:
        toString in class Object
        Returns:
        the string representation of this level.