logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From psm...@apache.org
Subject cvs commit: jakarta-log4j/src/java/org/apache/log4j/chainsaw RuleMediator.java
Date Wed, 17 Sep 2003 01:21:17 GMT
psmith      2003/09/16 18:21:17

  Modified:    src/java/org/apache/log4j/chainsaw RuleMediator.java
  Log:
  The Rule Mediator now distinguishes the Logger rule
  from the general Refinement rule.
  
  Revision  Changes    Path
  1.2       +39 -0     jakarta-log4j/src/java/org/apache/log4j/chainsaw/RuleMediator.java
  
  Index: RuleMediator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/chainsaw/RuleMediator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RuleMediator.java	9 Sep 2003 02:59:37 -0000	1.1
  +++ RuleMediator.java	17 Sep 2003 01:21:17 -0000	1.2
  @@ -73,6 +73,7 @@
   public class RuleMediator extends AbstractRule implements Rule {
   
   	private Rule inclusionRule;
  +	private Rule loggerRule;
   	private Rule refinementRule;
   	private Rule exclusionRule;
   	
  @@ -86,6 +87,10 @@
   			accepts = inclusionRule.evaluate(e);
   		}
   		if(!accepts) return false;
  +		if(loggerRule!=null) {
  +			accepts = loggerRule.evaluate(e);
  +		}
  +		if(!accepts) return false;
   		if(refinementRule!=null) {
   			accepts = refinementRule.evaluate(e);
   		}
  @@ -117,6 +122,12 @@
   		firePropertyChange("refinementRule", oldRefinementRule, this.refinementRule);
   	}
   	
  +	public void setLoggerRule(Rule r) {
  +		Rule oldLoggerRule = this.loggerRule;
  +		this.loggerRule = r;
  +		firePropertyChange("loggerRule", oldLoggerRule, this.loggerRule);
  +	}
  +	
   	/**
   	 * Sets the Exclusion rule to be used, and fires a PropertyChangeEvent to listeners.
   	 * 
  @@ -127,4 +138,32 @@
   		this.exclusionRule = r;
   		firePropertyChange("exclusionRule", oldExclusionRule, this.exclusionRule);
   	}
  +	/**
  +	 * @return
  +	 */
  +	public final Rule getExclusionRule() {
  +		return exclusionRule;
  +	}
  +
  +	/**
  +	 * @return
  +	 */
  +	public final Rule getInclusionRule() {
  +		return inclusionRule;
  +	}
  +
  +	/**
  +	 * @return
  +	 */
  +	public final Rule getLoggerRule() {
  +		return loggerRule;
  +	}
  +
  +	/**
  +	 * @return
  +	 */
  +	public final Rule getRefinementRule() {
  +		return refinementRule;
  +	}
  +
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org


Mime
View raw message