[slf4j-dev] svn commit: r413 - in slf4j/trunk: . lib tests tests/lib tests/src/java/org/slf4j

ceki at slf4j.org ceki at slf4j.org
Wed Oct 19 20:33:16 CEST 2005


Author: ceki
Date: Wed Oct 19 20:33:12 2005
New Revision: 413

Added:
   slf4j/trunk/lib/
   slf4j/trunk/lib/log4j-1.2.9.jar   (contents, props changed)
   slf4j/trunk/lib/log4j-1.3alpha-6.jar   (contents, props changed)
   slf4j/trunk/tests/lib/log4j-1.2.12.jar   (contents, props changed)
   slf4j/trunk/tests/lib/log4j-1.3alpha-6.jar   (contents, props changed)
Modified:
   slf4j/trunk/build.properties
   slf4j/trunk/build.xml
   slf4j/trunk/tests/build.xml
   slf4j/trunk/tests/src/java/org/slf4j/InvokingSLF4J.java
Log:

- Differentiating betwwen log4j 1.2 and 1.3 as they are not runtime compatible. 
- Preparing relase 1.0beta9




Modified: slf4j/trunk/build.properties
==============================================================================
--- slf4j/trunk/build.properties	(original)
+++ slf4j/trunk/build.properties	Wed Oct 19 20:33:12 2005
@@ -2,7 +2,7 @@
 # This properties file hold properties shared among several Ant
 # scripts
 
-version=1.0-beta8
+version=1.0-beta9
 
 jcl-version=104
 jcl.jar=jcl${jcl-version}-over-slf4j.jar
\ No newline at end of file

Modified: slf4j/trunk/build.xml
==============================================================================
--- slf4j/trunk/build.xml	(original)
+++ slf4j/trunk/build.xml	Wed Oct 19 20:33:12 2005
@@ -26,7 +26,8 @@
       
       slf4j-nop.jar - build the jar file of the same name.
       slf4j-simple.jar - build the jar file of the same name.
-      slf4j-log4j.jar - build the jar fil of the same name.
+      slf4j-log4j12.jar - build the jar file of the same name.
+      slf4j-log4j13.jar - build the jar file of the same name.
 	  slf4j-jdk14.jar - build the jar file of the same name.
       jcl-over-slf4j.jar - JCL 1.0.4 implemented over SLF4J	
       jar - all of the above jar files
@@ -42,9 +43,16 @@
 	<path id="regular.classpath">
 	</path>
 
-	<path id="log4j.classpath">
+	<path id="log4j12.classpath">
 		<fileset dir="./lib">
-			<include name="log4j*.jar" />
+			<include name="log4j-1.2*.jar" />
+		</fileset>
+	</path>
+
+
+	<path id="log4j13.classpath">
+		<fileset dir="./lib">
+			<include name="log4j-1.3*.jar" />
 		</fileset>
 	</path>
 
@@ -66,14 +74,25 @@
   	</fail>
 	</target>
 
-	<target name="log4jCheck">
-		<available classname="org.apache.log4j.Logger" property="log4jPresent">
-			<classpath refid="log4j.classpath"/>
+	<target name="log4j12Check">
+		<available classname="org.apache.log4j.Logger" property="log4j12Present">
+			<classpath refid="log4j12.classpath" />
 		</available>
 
-		<fail unless="log4jPresent">
+		<fail unless="log4j12Present">
         Building the SLF4J implementation for the log4j system 
-        requires the presence of log4j 1.2.x or later.
+        requires the presence of log4j 1.2.x.
+  	</fail>
+	</target>
+
+	<target name="log4j13Check">
+		<available classname="org.apache.log4j.Logger" property="log4j13Present">
+			<classpath refid="log4j13.classpath" />
+		</available>
+
+		<fail unless="log4j13Present">
+        Building the SLF4J implementation for the log4j system 
+        requires the presence of log4j 1.2.x.
   	</fail>
 	</target>
 
@@ -108,8 +127,8 @@
     	             ${SLF4J_STEM}/impl/MessageFormatter.java,
     	             ${SLF4J_STEM}/impl/Util.java
                      ${SLF4J_STEM}/impl/${impl}*.java
-    	             ${SLF4J_STEM}/spi/*.java" debug="${debug}">
-			 <classpath refid="${IMPL.CLASSPATH}"/>
+    	             ${SLF4J_STEM}/spi/*.java" debug="on">
+			<classpath refid="${IMPL.CLASSPATH}" />
 		</javac>
 
 	</target>
@@ -158,11 +177,19 @@
 		</antcall>
 	</target>
 
-	<target name="slf4j-log4j.jar" depends="log4jCheck">
+	<target name="slf4j-log4j12.jar" depends="log4j12Check">
+		<antcall target="slf4j-IMPL.jar">
+			<param name="IMPL" value="Log4j" />
+			<param name="jar-name" value="slf4j-log4j12.jar" />
+			<param name="IMPL.CLASSPATH" value="log4j12.classpath" />
+		</antcall>
+	</target>
+
+	<target name="slf4j-log4j13.jar" depends="log4j13Check">
 		<antcall target="slf4j-IMPL.jar">
 			<param name="IMPL" value="Log4j" />
-			<param name="jar-name" value="slf4j-log4j.jar" />
-			<param name="IMPL.CLASSPATH" value="log4j.classpath" />
+			<param name="jar-name" value="slf4j-log4j13.jar" />
+			<param name="IMPL.CLASSPATH" value="log4j13.classpath" />
 		</antcall>
 	</target>
 
@@ -196,7 +223,8 @@
 	</target>
 
 
-	<target name="jar" depends="slf4j-nop.jar, jcl-over-slf4j.jar, slf4j-simple.jar, slf4j-jdk14.jar" />
+	<target name="jar" depends="slf4j-nop.jar, jcl-over-slf4j.jar, slf4j-log4j12.jar, slf4j-log4j13.jar, 
+		                        slf4j-simple.jar, slf4j-jdk14.jar" />
 
 	<!-- Build Javadoc -->
 	<target name="javadoc" depends="init">
@@ -230,8 +258,8 @@
 
 		<javadoc destdir="${javadoc.dest}" packagenames="org.slf4j.*, org.apache.commons.logging.*" additionalparam="-breakiterator" version="true" protected="true" author="true" use="true" overview="src/docs/overview.html" doctitle="SLF4J version ${version}" windowtitle="SLF4J Version ${version}">
 
-			 <classpath refid="log4j.classpath"/>
-			
+			<classpath refid="log4j12.classpath" />
+
 			<sourcepath>
 				<path path="${tmp.java.source.dir}" />
 			</sourcepath>

Added: slf4j/trunk/lib/log4j-1.2.9.jar
==============================================================================
Binary file. No diff available.

Added: slf4j/trunk/lib/log4j-1.3alpha-6.jar
==============================================================================
Binary file. No diff available.

Modified: slf4j/trunk/tests/build.xml
==============================================================================
--- slf4j/trunk/tests/build.xml	(original)
+++ slf4j/trunk/tests/build.xml	Wed Oct 19 20:33:12 2005
@@ -55,13 +55,22 @@
 
 	<path id="log4j12x.classpath">
 		<path refid="basic.classpath" />
-		<pathelement location="../slf4j-log4j.jar" />
-		<fileset dir="../lib/">
-			<include name="log4j*.jar" />
-		</fileset>
+		<pathelement location="../slf4j-log4j12.jar" />
+		<pathelement location="../lib/log4j-1.2.9.jar" />
 	</path>
 
-
+	<path id="log4j1212.classpath">
+		<path refid="basic.classpath" />
+		<pathelement location="../slf4j-log4j12.jar" />
+		<pathelement location="./lib/log4j-1.2.12.jar" />
+	</path>
+		
+	<path id="log4j13alpha6.classpath">
+		<path refid="basic.classpath" />
+		<pathelement location="../slf4j-log4j13.jar" />
+    	<pathelement location="../lib/log4j-1.3alpha-6.jar" />
+	</path>
+	
 	<!-- ================================================================= -->
 	<!-- Default target                                                    -->
 	<!-- ================================================================= -->
@@ -72,7 +81,7 @@
       build - compile all project files, if a certain library is missing, 
               then the compilation of its dependents are skipped.
 
-      runAll - run all available tests
+      all - run all available tests
       
     </echo>
 	</target>
@@ -114,10 +123,15 @@
 		<ant dir=".." antfile="build.xml" target="slf4j-jdk14.jar" />
 	</target>
 
-	<target name="slf4j-log4j.jar">
-		<ant dir=".." antfile="build.xml" target="slf4j-log4j.jar" />
+	<target name="slf4j-log4j12.jar">
+		<ant dir=".." antfile="build.xml" target="slf4j-log4j12.jar" />
 	</target>
 
+	
+	<target name="slf4j-log4j13.jar">
+		<ant dir=".." antfile="build.xml" target="slf4j-log4j13.jar" />
+	</target>
+		
 	<target name="jcl-over-slf4j.jar">
 		<ant dir=".." antfile="build.xml" target="jcl-over-slf4j.jar" />
 	</target>
@@ -125,14 +139,15 @@
 	<!-- ================================================================= -->
 	<!-- Run all tests                                                     -->
 	<!-- ================================================================= -->
-	<target name="runAll" depends="regression" />
-
+	<target name="all" depends="regression" />
 
 	<target name="regression" depends="MessageFormatter,
                                      InvokeNOP,
                                      InvokeSimple,
-                                     InvokeJDK14,
+		                             InvokeJDK14,
 		                             InvokeLog4j12x,
+		                             InvokeLog4j1212,
+		                             InvokeLog4j13alpha6,
                                      InvokeNLOG4J12x,
   	                                 XLoggerBySystemProps,
   	                                 InvokeJCL,
@@ -171,18 +186,37 @@
 	</target>
 
 
-	<target name="InvokeLog4j12x" depends="build, cleanOutputDir">
+	<target name="InvokeLog4j12x" depends="build, slf4j-log4j12.jar, cleanOutputDir">
 		<copy file="input/log4j12x/basic.xml" tofile="${tests.javac.dest}/log4j.xml" />
 		<junit printsummary="yes" fork="yes" haltonfailure="yes">
 			<classpath refid="log4j12x.classpath" />
 			<formatter type="plain" usefile="false" />
 			<test name="org.slf4j.InvokingSLF4J" />
 		</junit>
+		<delete file="${tests.javac.dest}/log4j.xml" />
+	</target>
 
+	<target name="InvokeLog4j1212" depends="build, slf4j-log4j12.jar, cleanOutputDir">
+		<copy file="input/log4j12x/basic.xml" tofile="${tests.javac.dest}/log4j.xml" />
+		<junit printsummary="yes" fork="yes" haltonfailure="yes">
+			<classpath refid="log4j1212.classpath" />
+			<formatter type="plain" usefile="false" />
+			<test name="org.slf4j.InvokingSLF4J" />
+		</junit>
 		<delete file="${tests.javac.dest}/log4j.xml" />
+	</target>
 
+			
+	<target name="InvokeLog4j13alpha6" depends="build, slf4j-log4j13.jar, cleanOutputDir">
+		<junit printsummary="yes" fork="yes" haltonfailure="yes">
+			<classpath refid="log4j13alpha6.classpath" />
+			<formatter type="plain" usefile="false" />
+			<test name="org.slf4j.InvokingSLF4J" />
+		</junit>
+		<delete file="${tests.javac.dest}/log4j.xml" />
 	</target>
 
+	<!-- NLOG4J -->
 	<target name="InvokeNLOG4J12x" depends="build, cleanOutputDir">
 		<copy file="input/log4j12x/basic.xml" tofile="${tests.javac.dest}/log4j.xml" />
 		<junit printsummary="yes" fork="yes" haltonfailure="yes">
@@ -190,9 +224,7 @@
 			<formatter type="plain" usefile="false" />
 			<test name="org.slf4j.InvokingSLF4J" />
 		</junit>
-
 		<delete file="${tests.javac.dest}/log4j.xml" />
-
 	</target>
 
 	<target name="XLoggerBySystemProps" depends="build, slf4j-simple.jar, cleanOutputDir">

Added: slf4j/trunk/tests/lib/log4j-1.2.12.jar
==============================================================================
Binary file. No diff available.

Added: slf4j/trunk/tests/lib/log4j-1.3alpha-6.jar
==============================================================================
Binary file. No diff available.

Modified: slf4j/trunk/tests/src/java/org/slf4j/InvokingSLF4J.java
==============================================================================
--- slf4j/trunk/tests/src/java/org/slf4j/InvokingSLF4J.java	(original)
+++ slf4j/trunk/tests/src/java/org/slf4j/InvokingSLF4J.java	Wed Oct 19 20:33:12 2005
@@ -68,8 +68,20 @@
   }
   
   public void test2() {
+    Exception e = new Exception("This is a test exception.");
     Logger logger = LoggerFactory.getLogger("test2");
     logger.debug("Hello world 1.");
+    logger.debug("Hello world {}", new Integer(1));
+    logger.debug("Hello world 1", e);
     logger.info("Hello world 2.");
+    logger.info("Hello world {}", new Integer(2)); 
+    logger.warn("Hello world 3.");
+    logger.warn("Hello world 3.", e);
+    logger.warn("Hello world {}", new Integer(3)); 
+    logger.error("Hello world 4.");
+    logger.error("Hello world {}", new Integer(3)); 
+    logger.error("Hello world 4.", e);
+
+    
   }
 }



More information about the slf4j-dev mailing list