logback-android/src/main/java/ch/qos/logback/classic/turbo/DynamicThresholdFilter.java
@Override
  public FilterReply decide(Marker marker, Logger logger, Level level,
      String s, Object[] objects, Throwable throwable) {

    String mdcValue = MDC.get(this.key);
    if (!isStarted()) {
      return FilterReply.NEUTRAL;
    }

    Level levelAssociatedWithMDCValue = null;
    if (mdcValue != null) {
      levelAssociatedWithMDCValue = valueLevelMap.get(mdcValue);
    }
    if (levelAssociatedWithMDCValue == null) {
      levelAssociatedWithMDCValue = defaultThreshold;
    }
    if (level.isGreaterOrEqual(levelAssociatedWithMDCValue)) {
      return onHigherOrEqual;
    } else {
      return onLower;
    }
  }
@Override
  public FilterReply decide(Marker marker, Logger logger, Level level,
      String s, Object[] objects, Throwable throwable) {

    String mdcValue = MDC.get(this.key);
    if (!isStarted()) {
      return FilterReply.NEUTRAL;
    }

    Level levelAssociatedWithMDCValue = null;
    if (mdcValue != null) {
      levelAssociatedWithMDCValue = valueLevelMap.get(mdcValue);
    }
    if (levelAssociatedWithMDCValue == null) {
      levelAssociatedWithMDCValue = defaultThreshold;
    }
    if (level.isGreaterOrEqual(levelAssociatedWithMDCValue)) {
      return onHigherOrEqual;
    } else {
      return onLower;
    }
  }
@ Override public FilterReply decide ( Marker marker , Logger logger , Level level , String s , Object [ ] objects , Throwable throwable ) { String mdcValue = MDC . get ( this . key ) ; if ( ! isStarted ( ) ) { return FilterReply . NEUTRAL ; } Level levelAssociatedWithMDCValue = null ; if ( mdcValue != null ) { levelAssociatedWithMDCValue = valueLevelMap . get ( mdcValue ) ; } if ( levelAssociatedWithMDCValue == null ) { levelAssociatedWithMDCValue = defaultThreshold ; } if ( level . isGreaterOrEqual ( levelAssociatedWithMDCValue ) ) { return onHigherOrEqual ; } else { return onLower ; } }
This method first finds the MDC value for 'key'. It then finds the level
threshold associated with this MDC value from the list of MDCValueLevelPair
passed to this filter. This value is stored in a variable called
'levelAssociatedWithMDCValue'. If it null, then it is set to the
{@link #defaultThreshold} value.

@param marker
@param logger
@param level
@param s
@param objects
@param throwable

@return FilterReply - this filter's decision
This method first finds the MDC value for key . It then finds the level threshold associated with this MDC value from the list of MDCValueLevelPair passed to this filter . This value is stored in a variable called levelAssociatedWithMDCValue . If it null then it is set to the { @link #defaultThreshold } value .