[slf4j-dev] svn commit: r956 - in slf4j/trunk: slf4j-log4j12/src/main/java/org/slf4j/impl slf4j-site/src/site/pages

ceki at slf4j.org ceki at slf4j.org
Tue Jan 29 21:51:19 CET 2008


Author: ceki
Date: Tue Jan 29 21:51:19 2008
New Revision: 956

Modified:
   slf4j/trunk/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
   slf4j/trunk/slf4j-site/src/site/pages/codes.html
   slf4j/trunk/slf4j-site/src/site/pages/news.html

Log:
- fixing bug #64. The log4j binding will now alert the user that log4j version 1.2.12 or later is required.

Modified: slf4j/trunk/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
==============================================================================
--- slf4j/trunk/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java	(original)
+++ slf4j/trunk/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java	Tue Jan 29 21:51:19 2008
@@ -1,6 +1,5 @@
 /*
- * Copyright (c) 2004-2005 SLF4J.ORG
- * Copyright (c) 2004-2005 QOS.ch
+ * Copyright (c) 2004-2008 QOS.ch
  *
  * All rights reserved.
  *
@@ -33,6 +32,7 @@
 
 package org.slf4j.impl;
 
+import org.apache.log4j.Level;
 import org.slf4j.ILoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.slf4j.spi.LoggerFactoryBinder;
@@ -58,8 +58,12 @@
   private final ILoggerFactory loggerFactory;
   
   private StaticLoggerBinder() {
-//  Note: JCL gets substituted at build time by an appropriate Ant task
     loggerFactory = new Log4jLoggerFactory();
+    try {
+      Level level = Level.TRACE;
+    } catch(NoSuchFieldError nsfe) {
+      throw new Error("This version of SLF4J requires log4j version 1.2.12 or later. See also http://www.slf4j.org/codes.html#log4j_version", nsfe);
+    }
   }
   
   public ILoggerFactory getLoggerFactory() {

Modified: slf4j/trunk/slf4j-site/src/site/pages/codes.html
==============================================================================
--- slf4j/trunk/slf4j-site/src/site/pages/codes.html	(original)
+++ slf4j/trunk/slf4j-site/src/site/pages/codes.html	Tue Jan 29 21:51:19 2008
@@ -116,7 +116,7 @@
     <a name="log4j_version">
     </a>
     
-    <h3>SLF4J versions 1.4.0 and later require log4j 1.2.12 or later</h3>
+    <h3>SLF4J versions 1.4.0 and later requires log4j 1.2.12 or later</h3>
 
     <p>The trace level was added to log4j in version 1.2.12 released
     on August 29, 2005. The trace level was added to the SLF4J API in

Modified: slf4j/trunk/slf4j-site/src/site/pages/news.html
==============================================================================
--- slf4j/trunk/slf4j-site/src/site/pages/news.html	(original)
+++ slf4j/trunk/slf4j-site/src/site/pages/news.html	Tue Jan 29 21:51:19 2008
@@ -30,6 +30,31 @@
 
   <hr noshade="noshade" size="1"/>
 
+  <h3>February xxth, 2008 - Release of SLF4J 1.6.0</h3>
+
+  <p>Fixed <a href="http://bugzilla.slf4j.org/show_bug.cgi?id=61">bug
+  61</a> reported by Christopher Sahnwaldt. It is now possible to
+  place a backslash in front of a formatting anchor, by escaping the
+  backslash. For example, the call to
+  <code>MessageFormatter.format("C:\\\\{}", "foo")</code> will now
+  correctly return "C:\\foo". The backslash character needs to be
+  escaped in Java, which leads to four backslashes.
+  </p>
+
+ 
+  <p>Fixed <a href="http://bugzilla.slf4j.org/show_bug.cgi?id=63">bug
+  63</a> reported by Maarten Bosteels. SLF4J now supports MDC for
+  <code>java.util.logging</code> package.
+  </p>
+
+  <p>Fixed <a href="http://bugzilla.slf4j.org/show_bug.cgi?id=64">bug
+  64</a> reported by Michal Bernhard. The log4j binding will now alert
+  the user if she uses SLF4J with a version of log4j earlier than 1.2.12.
+  </p>
+
+
+  <hr noshade="noshade" size="1"/>
+
   <h3>August 20th, 2007 - Release of SLF4J 1.4.3</h3>
 
   <p>Fixed <a href="http://bugzilla.slf4j.org/show_bug.cgi?id=60">bug



More information about the slf4j-dev mailing list