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 Curt Arnold <ca...@apache.org> on 2005/08/16 07:08:17 UTC

log4j 1.2.12 proposal

The best option that I've found is to Jikes which doesn't appear to  
trigger the annoying warning when running on earlier JVM's.  Jikes  
did have a problem with a class implementing an interface method that  
had been marked deprecated, so in the following patch, the  
@deprecation on LoggerRepository.getCurrentCategories was downgraded  
to a comment.  The changes to LoggingReceiver workaround the  
compilation problem with JDK 1.2 javac, but isn't essential.  The  
changes to tests/build.xml (which is not distributed with log4j) is  
helpful for testing on earlier JVM's since many of the tests fail due  
to stack trace and serialization differences between JVM's and it is  
helpful to run all the tests (by specifying -Dhaltonfailure=no)  
instead of stopping at the first one.

To build using Jikes:

Download jikes-1.22-1.windows.zip, unzip and place on path.

ant -Dbuild.compiler=jikes -Dlogging-site=... dist



Index: src/java/org/apache/log4j/chainsaw/LoggingReceiver.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/ 
Attic/LoggingReceiver.java,v
retrieving revision 1.2.2.2
diff -u -r1.2.2.2 LoggingReceiver.java
--- src/java/org/apache/log4j/chainsaw/LoggingReceiver.java    24 May  
2005 05:06:18 -0000    1.2.2.2
+++ src/java/org/apache/log4j/chainsaw/LoggingReceiver.java    16 Aug  
2005 04:53:43 -0000
@@ -40,17 +40,21 @@
       *
       * @author <a href="mailto:oliver@puppycrawl.com">Oliver Burn</a>
       */
-    private class Slurper implements Runnable {
+    private static class Slurper implements Runnable {
          /** socket connection to read events from **/
          private final Socket mClient;
+        /** where to put the events **/
+        private final MyTableModel mModel;
+
          /**
           * Creates a new <code>Slurper</code> instance.
           *
           * @param aClient socket to receive events from
           */
-        Slurper(Socket aClient) {
+        Slurper(Socket aClient, MyTableModel aModel) {
              mClient = aClient;
+            mModel = aModel;
          }
          /** loops getting the events **/
@@ -82,10 +86,10 @@
      }
      /** where to put the events **/
-    private final MyTableModel mModel;
+    private MyTableModel mModel;
      /** server for listening for connections **/
-    private final ServerSocket mSvrSock;
+    private ServerSocket mSvrSock;
      /**
       * Creates a new <code>LoggingReceiver</code> instance.
@@ -109,7 +113,7 @@
                  final Socket client = mSvrSock.accept();
                  LOG.debug("Got a connection from " +
                            client.getInetAddress().getHostName());
-                final Thread t = new Thread(new Slurper(client));
+                final Thread t = new Thread(new Slurper(client,  
mModel));
                  t.setDaemon(true);
                  t.start();
              }
Index: src/java/org/apache/log4j/spi/LoggerRepository.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/spi/ 
LoggerRepository.java,v
retrieving revision 1.9.2.2
diff -u -r1.9.2.2 LoggerRepository.java
--- src/java/org/apache/log4j/spi/LoggerRepository.java    24 May  
2005 05:06:21 -0000    1.9.2.2
+++ src/java/org/apache/log4j/spi/LoggerRepository.java    16 Aug  
2005 04:53:43 -0000
@@ -89,7 +89,8 @@
    Enumeration getCurrentLoggers();
    /**
-     @deprecated Please use {@link #getCurrentLoggers} instead.  */
+   *  Gets an enumeration of categories.  Please use {@link  
#getCurrentLoggers} instead.
+   */
    public
    Enumeration getCurrentCategories();
Index: tests/build.xml
===================================================================
RCS file: /home/cvs/logging-log4j/tests/build.xml,v
retrieving revision 1.16.2.10
diff -u -r1.16.2.10 build.xml
--- tests/build.xml    22 Jul 2005 20:09:23 -0000    1.16.2.10
+++ tests/build.xml    16 Aug 2005 04:53:43 -0000
@@ -23,6 +23,7 @@
    <property name="tests.source.home" value="./src/java/"/>
    <property name="excludes" value=""/>
+  <property name="haltonfailure" value="yes"/>
    <path id="tests.classpath">
      <pathelement location="${project.source.home}"/>
@@ -135,7 +136,7 @@
    <!-- ============== Regression and Unit Tests follow  
================= -->
    <!--  
================================================================= -->
      <target name="Core" depends="build">
-      <junit printsummary="yes" fork="yes" haltonfailure="yes">
+      <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
          <classpath refid="tests.classpath"/>
          <formatter type="plain" usefile="false"/>
          <test name="org.apache.log4j.CoreTestSuite" />
@@ -144,7 +145,7 @@
    <target name="Minimum" depends="build">
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false"/>
        <test name="org.apache.log4j.MinimumTestCase" />
@@ -152,7 +153,7 @@
    </target>
    <target name="Logger" depends="build">
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false"/>
        <test name="org.apache.log4j.LoggerTestCase" />
@@ -160,7 +161,7 @@
    </target>
    <target name="PatternLayout" depends="build">
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false"/>
        <test name="org.apache.log4j.PatternLayoutTestCase" />
@@ -169,7 +170,7 @@
    <target name="HierarchyThreshold" depends="build">
      <delete file="output/temp"/>
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false"/>
        <test name="org.apache.log4j.HierarchyThresholdTestCase" />
@@ -177,7 +178,7 @@
    </target>
    <target name="DOM" depends="build">
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false"/>
        <test name="org.apache.log4j.xml.DOMTestCase" />
@@ -185,7 +186,7 @@
    </target>
    <target name="CustomLevel" depends="build">
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false" />
        <test name="org.apache.log4j.xml.CustomLevelTestCase" />
@@ -193,7 +194,7 @@
    </target>
    <target name="CustomLogger" depends="build">
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false" />
        <test name="org.apache.log4j.customLogger.XLoggerTestCase" />
@@ -205,14 +206,14 @@
      <delete file="classes/log4j.xml"/>
      <delete file="classes/log4j.properties"/>
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false"/>
        <test fork="true"  
name="org.apache.log4j.defaultInit.TestCase1" />
      </junit>
      <copy file="input/xml/defaultInit.xml" tofile="classes/ 
log4j.xml"/>
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false"/>
        <test fork="true"  
name="org.apache.log4j.defaultInit.TestCase2" />
@@ -221,7 +222,7 @@
      <!-- test handling of log4j.defaultInitOverride system property  
-->
      <copy file="input/xml/defaultInit.xml" tofile="classes/ 
log4j.xml"/>
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <jvmarg value="-Dlog4j.defaultInitOverride=true"/>
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false"/>
@@ -231,7 +232,7 @@
      <!-- test default initialization from log4j.xml -->
      <copy file="input/defaultInit3.properties" tofile="classes/ 
log4j.properties"/>
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false"/>
        <test fork="true"  
name="org.apache.log4j.defaultInit.TestCase3" />
@@ -241,7 +242,7 @@
      <!-- test default initialization from log4j.properties -->
      <copy file="input/xml/defaultInit.xml" tofile="classes/ 
log4j.xml"/>
      <copy file="input/defaultInit3.properties" tofile="classes/ 
log4j.properties"/>
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false"/>
        <test fork="true"  
name="org.apache.log4j.defaultInit.TestCase4" />
@@ -270,7 +271,7 @@
    </target>
    <target name="XMLLayout" depends="build">
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false" />
        <test name="org.apache.log4j.xml.XMLLayoutTestCase" />
@@ -278,7 +279,7 @@
    </target>
    <target name="AsyncAppender" depends="build">
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false" />
        <test name="org.apache.log4j.AsyncAppenderTestCase" />
@@ -286,7 +287,7 @@
    </target>
    <target name="LevelMatchFilter" depends="build">
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false"/>
        <test name="org.apache.log4j.varia.LevelMatchFilterTestCase" />
@@ -294,7 +295,7 @@
    </target>
    <target name="ErrorHandler" depends="build">
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false" />
        <test name="org.apache.log4j.varia.ErrorHandlerTestCase" />
@@ -302,7 +303,7 @@
    </target>
    <target name="OptionConverter" depends="build">
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false"/>
        <test name="org.apache.log4j.helpers.OptionConverterTestCase" />
@@ -310,7 +311,7 @@
    </target>
    <target name="BoundedFIFO" depends="build">
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false"/>
        <test name="org.apache.log4j.helpers.BoundedFIFOTestCase" />
@@ -318,7 +319,7 @@
    </target>
    <target name="CyclicBuffer" depends="build">
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false"/>
        <test name="org.apache.log4j.helpers.CyclicBufferTestCase" />
@@ -326,7 +327,7 @@
    </target>
    <target name="PatternParser" depends="build">
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false"/>
        <test name="org.apache.log4j.helpers.PatternParserTestCase" />
@@ -335,7 +336,7 @@
    <target name="OR" depends="build">
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false"/>
        <test name="org.apache.log4j.or.ORTestCase" />
@@ -343,7 +344,7 @@
    </target>
    <target name="DRFA" depends="build">
-    <junit printsummary="yes" fork="yes" haltonfailure="yes">
+    <junit printsummary="yes" fork="yes" haltonfailure="$ 
{haltonfailure}">
        <classpath refid="tests.classpath"/>
        <formatter type="plain" usefile="false"/>
        <test name="org.apache.log4j.DRFATestCase" />
  

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