[slf4j-dev] svn commit: r509 - in slf4j/trunk/src/java/org/slf4j: . impl

ceki at slf4j.org ceki at slf4j.org
Mon Jan 23 12:26:01 CET 2006


Author: ceki
Date: Mon Jan 23 12:26:00 2006
New Revision: 509

Removed:
   slf4j/trunk/src/java/org/slf4j/Constants.java
Modified:
   slf4j/trunk/src/java/org/slf4j/Marker.java
   slf4j/trunk/src/java/org/slf4j/impl/SystemPropBinder.java
Log:


Modified: slf4j/trunk/src/java/org/slf4j/Marker.java
==============================================================================
--- slf4j/trunk/src/java/org/slf4j/Marker.java	(original)
+++ slf4j/trunk/src/java/org/slf4j/Marker.java	Mon Jan 23 12:26:00 2006
@@ -49,6 +49,17 @@
 public interface Marker {
  
   /**
+   * This constant symbolizes any marker, including a null marker.
+   */
+  public static final String ANY_MARKER = "*";
+  
+  /**
+   * This constant symbolizes any non-null marker.
+   */
+  public static final String ANY_NON_NULL_MARKER = "+";
+  
+  
+  /**
    * Get the name of this Marker.
    * @return name of marker
    */ 

Modified: slf4j/trunk/src/java/org/slf4j/impl/SystemPropBinder.java
==============================================================================
--- slf4j/trunk/src/java/org/slf4j/impl/SystemPropBinder.java	(original)
+++ slf4j/trunk/src/java/org/slf4j/impl/SystemPropBinder.java	Mon Jan 23 12:26:00 2006
@@ -32,23 +32,37 @@
  */
 package org.slf4j.impl;
 
-import org.slf4j.Constants;
 import org.slf4j.ILoggerFactory;
 import org.slf4j.spi.LoggerFactoryBinder;
 
 /**
- * Allows for dynamic binding as specified by information contained
- * in the {@link Constants#LOGGER_FACTORY_PROPERTY} java system property.
+ * Allows for dynamic binding as specified by information contained in the
+ * {@link Constants#LOGGER_FACTORY_PROPERTY} java system property.
  * 
  * @author Ceki Gülcü
  */
 public class SystemPropBinder implements LoggerFactoryBinder {
+
+  /**
+   * The name of the system property to set in order to instruct
+   * {@link LoggerFactory} class to use a specific ILoggerFactory.
+   */
+  final public static String LOGGER_FACTORY_PROPERTY = "org.slf4j.factory";
+
+  /**
+   * Constant used to determine the name of the factory method for creating
+   * logger factories.
+   */
+  final public static String LOGGER_FACTORY_FACTORY_METHOD_NAME = "getInstance";
+
   String factoryFactoryClassName = null;
 
   /**
-   * Fetch the appropriate ILoggerFactory as instructed by the system properties.
+   * Fetch the appropriate ILoggerFactory as instructed by the system
+   * properties.
    * 
    * Constants.LOGGER_FACTORY_FACTORY_METHOD_NAME
+   * 
    * @return The appropriate ILoggerFactory instance as directed from the system
    *         properties
    */
@@ -62,7 +76,7 @@
       Class factoryFactoryClass = Class.forName(getLoggerFactoryClassStr());
       Class[] EMPTY_CLASS_ARRAY = {};
       java.lang.reflect.Method factoryFactoryMethod = factoryFactoryClass
-          .getDeclaredMethod(Constants.LOGGER_FACTORY_FACTORY_METHOD_NAME,
+          .getDeclaredMethod(LOGGER_FACTORY_FACTORY_METHOD_NAME,
               EMPTY_CLASS_ARRAY);
       ILoggerFactory loggerFactory = (ILoggerFactory) factoryFactoryMethod
           .invoke(null, null);
@@ -80,11 +94,9 @@
   public String getLoggerFactoryClassStr() {
     if (factoryFactoryClassName == null) {
       try {
-        factoryFactoryClassName = System
-            .getProperty(Constants.LOGGER_FACTORY_PROPERTY);
+        factoryFactoryClassName = System.getProperty(LOGGER_FACTORY_PROPERTY);
       } catch (Exception e) {
-        Util.reportFailure("Failed to fetch "
-            + Constants.LOGGER_FACTORY_PROPERTY
+        Util.reportFailure("Failed to fetch " + LOGGER_FACTORY_PROPERTY
             + " system property.", e);
       }
     }



More information about the slf4j-dev mailing list