--- slf4j-1.5.5/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java.orig Fri Oct 17 17:34:16 2008 +++ slf4j-1.5.5/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java Fri Nov 14 15:37:54 2008 @@ -28,7 +28,6 @@ import java.util.Arrays; import java.util.List; -import org.slf4j.helpers.SubstituteLoggerFactory; import org.slf4j.helpers.Util; import org.slf4j.impl.StaticLoggerBinder; @@ -50,8 +49,6 @@ */ public final class LoggerFactory { - static ILoggerFactory loggerFactory; - static final String NO_STATICLOGGERBINDER_URL = "http://www.slf4j.org/codes.html#StaticLoggerBinder"; static final String NULL_LF_URL = "http://www.slf4j.org/codes.html#null_LF"; static final String VERSION_MISMATCH = "http://www.slf4j.org/codes.html#version_mismatch"; @@ -79,11 +76,8 @@ // support re-entrant behavior. // See also http://bugzilla.slf4j.org/show_bug.cgi?id=106 List loggerNameList = new ArrayList(); - loggerFactory = new SubstituteLoggerFactory(loggerNameList); - loggerFactory = StaticLoggerBinder.SINGLETON.getLoggerFactory(); emitSubstitureLoggerWarning(loggerNameList); } catch (NoClassDefFoundError ncde) { - loggerFactory = null; // undo SubstituteLoggerFactory assignment String msg = ncde.getMessage(); if (msg != null && msg.indexOf("org/slf4j/impl/StaticLoggerBinder") != -1) { Util @@ -94,7 +88,6 @@ } throw ncde; } catch (Exception e) { - loggerFactory = null; // undo SubstituteLoggerFactory assignment // we should never get here Util.reportFailure("Failed to instantiate logger [" + StaticLoggerBinder.SINGLETON.getLoggerFactoryClassStr() + "]", e); @@ -153,6 +146,7 @@ * @return logger */ public static Logger getLogger(String name) { + ILoggerFactory loggerFactory = StaticLoggerBinder.SINGLETON.getLoggerFactory(); if (loggerFactory == null) { throw new IllegalStateException( "Logging factory implementation cannot be null. See also " @@ -170,6 +164,7 @@ * @return logger */ public static Logger getLogger(Class clazz) { + ILoggerFactory loggerFactory = StaticLoggerBinder.SINGLETON.getLoggerFactory(); if (loggerFactory == null) { throw new IllegalStateException( "Logging factory implementation cannot be null. See also " @@ -187,6 +182,6 @@ * @return the ILoggerFactory instance in use */ public static ILoggerFactory getILoggerFactory() { - return loggerFactory; + return StaticLoggerBinder.SINGLETON.getLoggerFactory(); } }