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 mw...@apache.org on 2002/06/11 09:12:14 UTC

FW: cvs commit: jakarta-log4j/src/java/org/apache/log4j/filters package.html NDCMatchFilter.java MDCMatchFilter.java MatchFilterBase.java LevelMatchFilter.java

I created the o.a.log4j.filters package, a MatchFilterBase class (as
previously discussed), and subclasses that use it.  Please review at your
convenience.

I have probably broken a project guideline as I have not implemented test
cases for the 3 subclasses yet, so use them at your own risk.  I will apply
comments and rigorously test them with some test cases Tuesday night.

-Mark

-----Original Message-----
From: mwomack@apache.org [mailto:mwomack@apache.org]
Sent: Tuesday, June 11, 2002 12:05 AM
To: jakarta-log4j-cvs@apache.org
Subject: cvs commit: jakarta-log4j/src/java/org/apache/log4j/filters
package.html NDCMatchFilter.java MDCMatchFilter.java
MatchFilterBase.java LevelMatchFilter.java


mwomack     2002/06/11 00:04:54

  Added:       src/java/org/apache/log4j/filters package.html
                        NDCMatchFilter.java MDCMatchFilter.java
                        MatchFilterBase.java LevelMatchFilter.java
  Log:
  Added MatchFilterBase class to log4j.filters package and three subclasses
to match specific things: LevelMatchFilter, MDCMatchFilter, and
NDCMatchFilter.  LevelMatchFilter and NDCMatchFilter are versions moved from
the varia package, but changed to subclass from MatchFilterBase.

  Revision  Changes    Path
  1.1
jakarta-log4j/src/java/org/apache/log4j/filters/package.html


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: FW: cvs commit: jakarta-log4j/src/java/org/apache/log4j/filters package.html NDCMatchFilter.java MDCMatchFilter.java MatchFilterBase.java LevelMatchFilter.java

Posted by Ceki Gülcü <ce...@qos.ch>.
Mark,

This is very good work.

As usual, I have a few (unusually few) comments. I'll start by the
minor ones.

1) Option names (i.e. javabeans properties) are always in bold in the
javadocs.

2) You have stuck to "my" preferred formatting style:

public
static
void abs(int x) {
   try { // Try/catch block not necessary.
     if(x < 0) {
        return -x;
     } else {
        return x;
      }
    } catch(Exception e) {
       ...
    }
}

I obviously like this indention style but no one else in the world
outside log4j uses it.  Given the number of people who read log4j code
and the potential number of developers, I think we should stick to
Sun's conventions: http://java.sun.com/docs/codeconv/

So the above code should be indented as

public static void abs(int x) {
   try {
     if(x < 0) {
        return -x;
     } else {
        return x;
      }
    } catch(Exception e) {
       ...
    }
}

The difference is quite small but there is a difference nonetheless.
We'll move log4j code from my style to Sun's style little by
little. We can start by fresh code written for log4j 1.3. I'll write a
codingstyle.html page explaining all this as soon as I get the time.
Previous to this email, this was all a mental note so you had no way
of knowing.

Coming back to your contribution, it contains an interesting bug that
you will discover immediately when you write the first test case. I
won't say more. I might even be wrong but the test cases will show. By
the way, did I thank you for your excellent work?

At 00:12 11.06.2002 -0700, mwomack@apache.org wrote:
>I created the o.a.log4j.filters package, a MatchFilterBase class (as
>previously discussed), and subclasses that use it.  Please review at your
>convenience.
>
>I have probably broken a project guideline as I have not implemented test
>cases for the 3 subclasses yet, so use them at your own risk.  I will apply
>comments and rigorously test them with some test cases Tuesday night.
>
>-Mark
>
>-----Original Message-----
>From: mwomack@apache.org [mailto:mwomack@apache.org]
>Sent: Tuesday, June 11, 2002 12:05 AM
>To: jakarta-log4j-cvs@apache.org
>Subject: cvs commit: jakarta-log4j/src/java/org/apache/log4j/filters
>package.html NDCMatchFilter.java MDCMatchFilter.java
>MatchFilterBase.java LevelMatchFilter.java
>
>
>mwomack     2002/06/11 00:04:54
>
>   Added:       src/java/org/apache/log4j/filters package.html
>                         NDCMatchFilter.java MDCMatchFilter.java
>                         MatchFilterBase.java LevelMatchFilter.java
>   Log:
>   Added MatchFilterBase class to log4j.filters package and three subclasses
>to match specific things: LevelMatchFilter, MDCMatchFilter, and
>NDCMatchFilter.  LevelMatchFilter and NDCMatchFilter are versions moved from
>the varia package, but changed to subclass from MatchFilterBase.
>
>   Revision  Changes    Path
>   1.1
>jakarta-log4j/src/java/org/apache/log4j/filters/package.html

--
Ceki

SUICIDE BOMBING - A CRIME AGAINST HUMANITY
Sign the petition: http://www.petitiononline.com/1234567b
I am signatory number 22106. What is your number?


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>