Class MessageLevel


  • public final class MessageLevel
    extends Object
    Constants that define the level of the messages that are to be recorded by the LogManager.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  MessageLevel.DisplayNames
      Constants that define the types of the messages that are to be recorded by the LogManager.
      static class  MessageLevel.Labels
      Constants that define the types of the messages that are to be recorded by the LogManager.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int CRITICAL
      Message level value that specifies that critical messages are to be recorded.
      static int DEFAULT_MESSAGE_LEVEL
      The default message level is WARNING.
      static int DETAIL
      Message level value that specifies that detailed, information, warning, error and critical messages are to be recorded.
      static int ERROR
      Message level value that specifies that error messages and critical messages are to be recorded.
      static int INFO
      Message level value that specifies that information, warning, error and critical messages are to be recorded.
      static int NONE
      Message level value that specifies that no messages are to be recorded.
      static int TRACE
      Message level value that specifies that all messages are to be recorded.
      static int WARNING
      Message level value that specifies that warning, error and critical messages are to be recorded.
    • Constructor Summary

      Constructors 
      Constructor Description
      MessageLevel()  
    • Field Detail

      • NONE

        public static final int NONE
        Message level value that specifies that no messages are to be recorded.
        See Also:
        Constant Field Values
      • CRITICAL

        public static final int CRITICAL
        Message level value that specifies that critical messages are to be recorded.
        See Also:
        Constant Field Values
      • ERROR

        public static final int ERROR
        Message level value that specifies that error messages and critical messages are to be recorded.
        See Also:
        Constant Field Values
      • WARNING

        public static final int WARNING
        Message level value that specifies that warning, error and critical messages are to be recorded.
        See Also:
        Constant Field Values
      • INFO

        public static final int INFO
        Message level value that specifies that information, warning, error and critical messages are to be recorded.
        See Also:
        Constant Field Values
      • DETAIL

        public static final int DETAIL
        Message level value that specifies that detailed, information, warning, error and critical messages are to be recorded.
        See Also:
        Constant Field Values
      • TRACE

        public static final int TRACE
        Message level value that specifies that all messages are to be recorded.
        See Also:
        Constant Field Values
      • DEFAULT_MESSAGE_LEVEL

        public static final int DEFAULT_MESSAGE_LEVEL
        The default message level is WARNING.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MessageLevel

        public MessageLevel()
    • Method Detail

      • isMessageLevelValid

        public static boolean isMessageLevelValid​(int newMessageLevel)
        Utility method to set the level of messages that are recorded for this VM.
        Parameters:
        newMessageLevel - the new level; must be either MessageLevel.NONE, MessageLevel.CRITICAL, MessageLevel.ERROR, MessageLevel.WARNING, MessageLevel.INFO, MessageLevel.DETAIL, or MessageLevel.TRACE.
        Throws:
        IllegalArgumentException - if the level is out of range.
      • getValidLowerMessageLevel

        public static int getValidLowerMessageLevel()
        Utility method for knowing what is the lower boundary for a valid message level.
        Returns:
        int message level
        See Also:
        NONE
      • getValidUpperMessageLevel

        public static int getValidUpperMessageLevel()
        Utility method for knowing what is the upper boundary for a valid message level.
        Returns:
        int message level
        See Also:
        TRACE
      • getLabelForLevel

        public static String getLabelForLevel​(int level)
      • getMinimumLevel

        public static int getMinimumLevel()
      • getMaximumLevel

        public static int getMaximumLevel()
      • getDisplayNames

        public static Collection getDisplayNames()
      • getLabels

        public static List getLabels()
        Utility method to get the labels for the levels, starting with the lowest level and ending with the highest level.
        Returns:
        an ordered list of String labels