Class LevelRangeFilter

  • All Implemented Interfaces:
    java.util.logging.Filter

    public final class LevelRangeFilter
    extends java.lang.Object
    implements java.util.logging.Filter
    Log only messages that fall within a level range.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int max  
      private boolean maxInclusive  
      private int min  
      private boolean minInclusive  
    • Constructor Summary

      Constructors 
      Constructor Description
      LevelRangeFilter​(java.util.logging.Level min, boolean minInclusive, java.util.logging.Level max, boolean maxInclusive)
      Create a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isLoggable​(java.util.logging.LogRecord record)
      Determine if a record is loggable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • min

        private final int min
      • max

        private final int max
      • minInclusive

        private final boolean minInclusive
      • maxInclusive

        private final boolean maxInclusive
    • Constructor Detail

      • LevelRangeFilter

        public LevelRangeFilter​(java.util.logging.Level min,
                                boolean minInclusive,
                                java.util.logging.Level max,
                                boolean maxInclusive)
        Create a new instance.
        Parameters:
        min - the minimum (least severe) level, inclusive
        minInclusive - true if the min value is inclusive, false if it is exclusive
        max - the maximum (most severe) level, inclusive
        maxInclusive - true if the max value is inclusive, false if it is exclusive
    • Method Detail

      • isLoggable

        public boolean isLoggable​(java.util.logging.LogRecord record)
        Determine if a record is loggable.
        Specified by:
        isLoggable in interface java.util.logging.Filter
        Parameters:
        record - the log record
        Returns:
        true if the record's level falls within the range specified for this instance