You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-cvs@jakarta.apache.org by ce...@apache.org on 2001/01/10 02:04:07 UTC

cvs commit: jakarta-log4j/packaging initialize

ceki        01/01/09 17:04:07

  Modified:    .        build.inc
               doc      manual.html
               org/apache/log4j/examples mycat.good
               org/apache/log4j/xml/examples XCategory.java
               packaging initialize
  Log:
  Small fixes.
  
  Revision  Changes    Path
  1.6       +1 -1      jakarta-log4j/build.inc
  
  Index: build.inc
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/build.inc,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- build.inc	2001/01/09 21:25:06	1.5
  +++ build.inc	2001/01/10 01:04:05	1.6
  @@ -75,7 +75,7 @@
       <property name="classes" value="classes" />
       <property name="stem" value="org/apache/log4j" />
       <property name="build.compiler" value="jikes"/>	
  -    <property name="version" value="1.0.1 "/>  
  +    <property name="version" value="1.0.1"/>  
     </target>
   
   
  
  
  
  1.4       +1 -1      jakarta-log4j/doc/manual.html
  
  Index: manual.html
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/doc/manual.html,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- manual.html	2000/12/14 22:11:17	1.3
  +++ manual.html	2001/01/10 01:04:05	1.4
  @@ -18,7 +18,7 @@
   href="http://www.javaworld.com/jw-11-2000/jw-1122-log4j.html">"Log4j
   delivers control over logging"</a> published in November 2000 edition
   of <a href="http://www.javaworld.com">JavaWorld</a>. However, the
  -present article contains more details and upto date information.
  +present article contains more detailed and up to date information.
   <hr>
   
   <h2>Abstract</h2>
  
  
  
  1.3       +3 -3      jakarta-log4j/org/apache/log4j/examples/mycat.good
  
  Index: mycat.good
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/examples/mycat.good,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- mycat.good	2000/12/26 23:39:07	1.2
  +++ mycat.good	2001/01/10 01:04:06	1.3
  @@ -14,9 +14,9 @@
   log4j.appender.A1.layout.ConversionPattern=[%t] %c - %m%n
   
   
  -# Set the priority of "some.cat". This will have the side effect of
  -# instantiating the category "some.cat" which will later cause a
  -# ClassCastException.
  +# Set the priority of "some.cat". This will actually have the side
  +# effect of instanciating a MyCategory object having the name
  +# "some.cat".
   
   log4j.category.some.cat=DEBUG
   
  
  
  
  1.4       +26 -12    jakarta-log4j/org/apache/log4j/xml/examples/XCategory.java
  
  Index: XCategory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/org/apache/log4j/xml/examples/XCategory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XCategory.java	2001/01/10 00:20:40	1.3
  +++ XCategory.java	2001/01/10 01:04:06	1.4
  @@ -13,6 +13,7 @@
   import org.apache.log4j.spi.OptionHandler;
   import org.apache.log4j.spi.LoggingEvent;
   import org.apache.log4j.spi.CategoryFactory;
  +import org.apache.log4j.helpers.LogLog;
   
   import org.apache.log4j.xml.examples.XPriority;
   
  @@ -22,8 +23,12 @@
      Note that sub-classes follow the hiearchy even if its categories
      belong to different classes.
   
  -   See <b><a href="doc-files/XCategory.java">source
  -   code</a></b> for more details.
  +   See <b><a href="doc-files/XCategory.java">source code</a></b> for
  +   more details. See also <a
  +   href="doc-files/extension1.xml">extension1.xml</a> and <a
  +   href="doc-files/extension2.xml">extension2.xml</a> XML configuration
  +   files.
  +
      
    */
   public class XCategory extends Category implements OptionHandler {
  @@ -36,7 +41,7 @@
     
     public static final String SUFFIX_OPTION = "Suffix";
   
  -  String suffix;
  +  String suffix = "";
   
     /**
        Just calls the parent constuctor.
  @@ -50,8 +55,8 @@
     }
   
     /**
  -     Overrides the standard debug method by appending " world" to each
  -     message.  */
  +     Overrides the standard debug method by appending the value of
  +     suffix variable to each message.  */
     public 
     void debug(String message) {
       log(instanceFQCN, Priority.DEBUG, message + suffix, null);
  @@ -68,34 +73,43 @@
       return Category.getInstance(name, factory); 
     }
   
  -  /**
   
  -   */
  + /**
  +    Retuns the option names for this component, namely the string
  +    {@link #SUFFIX_OPTION}.
  + */
     public
     String[] getOptionStrings() {
       return (new String[] {SUFFIX_OPTION});
     }
   
  + /**
  +     Set XCategory specific options.
  +
  +     <p>The <b>Suffix</b> option is the only recognized option. It
  +     takes a string value.
  +     */
     public
     void setOption(String option, String value) {
  -    System.out.println(option+"="+value);
       if(option == null) {
         return;
       }
       if(option.equalsIgnoreCase(SUFFIX_OPTION)) {
         this.suffix = value;
  -      System.out.println("Setting suffix to"+suffix);
  -
  +      LogLog.debug("Setting suffix to"+suffix);
       }
     }
   
  +  /**
  +     We introduce a new printing method that takes the TRACE priority.
  +  */
     public
     void trace(String message) { 
       // disable is defined in Category
       if(disable <=  XPriority.TRACE_INT) return;   
       if(XPriority.TRACE.isGreaterOrEqual(this.getChainedPriority()))
  -      callAppenders(new LoggingEvent(instanceFQCN, this, XPriority.TRACE, message, 
  -				     null));
  +      callAppenders(new LoggingEvent(instanceFQCN, this, XPriority.TRACE, 
  +				     message, null));
     }
   
   
  
  
  
  1.3       +2 -0      jakarta-log4j/packaging/initialize
  
  Index: initialize
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/packaging/initialize,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- initialize	2000/12/14 22:11:20	1.2
  +++ initialize	2001/01/10 01:04:06	1.3
  @@ -93,6 +93,8 @@
     ln -s ../XMLSample.java
     ln -s ../sample1.xml
     ln -s ../sample2.xml
  +  ln -s ../extension1.xml
  +  ln -s ../extension2.xml
     ln -s ../XCategory.java
     ln -s ../XTest.java
     popd > /dev/null