You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Paul Smith <pa...@lawlex.com.au> on 2004/01/08 02:15:48 UTC

Re: cvs commit: logging-log4j/src/java/org/apache/log4j/rule InFixToPostFix.java ExpressionRule.java

Scott, nice work, you might want to also consider adding a menu item to
the Help menu that references this class's javadoc. (See how the
Receiver docs get added in the ChainsawToolbarsAndMenus class, the
HelpManager will be able to find either local or remote help resources)

Could do the same with a '?' icon next to the Refine focus text field or
something.

cheers,

Paul

On Thu, 2004-01-08 at 12:06, sdeboy@apache.org wrote:
> sdeboy      2004/01/07 17:06:52
> 
>   Modified:    src/java/org/apache/log4j/rule InFixToPostFix.java
>                         ExpressionRule.java
>   Log:
>   Updated expressionrule and infixtopostfix javadocs
>   
>   Revision  Changes    Path
>   1.2       +16 -9     logging-log4j/src/java/org/apache/log4j/rule/InFixToPostFix.java
>   
>   Index: InFixToPostFix.java
>   ===================================================================
>   RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/rule/InFixToPostFix.java,v
>   retrieving revision 1.1
>   retrieving revision 1.2
>   diff -u -r1.1 -r1.2
>   --- InFixToPostFix.java	14 Dec 2003 20:35:08 -0000	1.1
>   +++ InFixToPostFix.java	8 Jan 2004 01:06:52 -0000	1.2
>   @@ -61,7 +61,22 @@
>     * Currently grouping is supported, as well as all of the Rules supported by <code>RuleFactory</code>
>     * 
>     * NOTE: parsing is supported through the use of <code>StringTokenizer</code>, which means 
>   - * all tokens in the expression must be separated by spaces. 
>   + * all tokens in the expression must be separated by spaces.
>   + * 
>   + * Supports grouping via parens, mult-word operands using single quotes, and these operators:
>   + * 
>   + * !        NOT operator
>   + * !=       NOT EQUALS operator
>   + * ==       EQUALS operator 
>   + * ~=       CASE-INSENSITIVE equals operator
>   + * ||       OR operator
>   + * &&       AND operator
>   + * like     REGEXP operator
>   + * exists   NOT NULL operator
>   + * &lt      LESS THAN operator
>   + * &gt      GREATER THAN operator
>   + * &lt=     LESS THAN EQUALS operator
>   + * &gt=     GREATER THAN EQUALS operator
>     * 
>     * @author Scott Deboy <sd...@apache.org>
>     */
>   @@ -85,10 +100,6 @@
>        operators.add("<=");
>        operators.add(">=");
>        
>   -    operators.add("*");
>   -    operators.add("+");
>   -    operators.add("-");
>   -
>        //boolean precedence
>        precedenceMap.put("<", new Integer(3));
>        precedenceMap.put(">", new Integer(3));
>   @@ -104,10 +115,6 @@
>        
>        precedenceMap.put("||", new Integer(2));
>        precedenceMap.put("&&", new Integer(2));
>   -
>   -    precedenceMap.put("-", new Integer(2));
>   -    precedenceMap.put("+", new Integer(2));
>   -    precedenceMap.put("*", new Integer(3));
>      }
>    
>      public String convert(String expression) {
>   
>   
>   
>   1.2       +11 -5     logging-log4j/src/java/org/apache/log4j/rule/ExpressionRule.java
>   
>   Index: ExpressionRule.java
>   ===================================================================
>   RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/rule/ExpressionRule.java,v
>   retrieving revision 1.1
>   retrieving revision 1.2
>   diff -u -r1.1 -r1.2
>   --- ExpressionRule.java	14 Dec 2003 20:35:08 -0000	1.1
>   +++ ExpressionRule.java	8 Jan 2004 01:06:52 -0000	1.2
>   @@ -61,11 +61,17 @@
>     *
>     * NOTE: parsing is supported through the use of <code>StringTokenizer</code>, which
>     * implies two limitations:
>   - * 1: all tokens in the expression must be separated by spaces,
>   - * 2: operands which contain spaces in the value being evaluated are not supported
>   - *    (for example, attempting to perform 'msg == some other msg' will fail, since 'some other msg'
>   - *    will be parsed as individual tokens in the expression instead of a single token (this is
>   - *    the next planned fix).
>   + * 1: all tokens in the expression must be separated by spaces, including parenthese
>   + * 2: operands which contain spaces MUST be wrapped in single quotes. 
>   + *    For example, the expression:
>   + *      msg == 'some msg'
>   + *    is a valid expression.
>   + * 3: To group expressions, use parentheses.
>   + *    For example, the expression:
>   + *      level >= INFO || ( msg == 'some msg' || logger == 'test' ) 
>   + *    is a valid expression.
>   + * See org.apache.log4j.rule.InFixToPostFix for a description of supported operators.
>   + * See org.apache.log4j.spi.LoggingEventFieldResolver for field keywords.
>     *
>     * @author Scott Deboy <sd...@apache.org>
>     */
>   
>   
>   
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org


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