Author: ceki
Date: Sun Aug 28 16:47:32 2005
New Revision: 226
Added:
nlog4j/trunk/src/java/org/slf4j/MarkerFactory.java
nlog4j/trunk/src/java/org/slf4j/spi/MarkerFactoryBinder.java
Modified:
nlog4j/trunk/src/java/org/slf4j/LoggerFactory.java
Log:
sync with latest SLF4J
Modified: nlog4j/trunk/src/java/org/slf4j/LoggerFactory.java
==============================================================================
--- nlog4j/trunk/src/java/org/slf4j/LoggerFactory.java (original)
+++ nlog4j/trunk/src/java/org/slf4j/LoggerFactory.java Sun Aug 28 16:47:32 2005
@@ -32,6 +32,8 @@
*/
package org.slf4j;
+
+import org.slf4j.impl.StaticBinder;
import org.slf4j.impl.SystemPropBinder;
import org.slf4j.impl.Util;
@@ -123,9 +125,4 @@
public static ILoggerFactory getILoggerFactory() {
return loggerFactory;
}
-
- public static StaticBinder getStaticBinder() {
- return staticBinder;
- }
-
}
Added: nlog4j/trunk/src/java/org/slf4j/MarkerFactory.java
==============================================================================
--- (empty file)
+++ nlog4j/trunk/src/java/org/slf4j/MarkerFactory.java Sun Aug 28 16:47:32 2005
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2004-2005 SLF4J.ORG
+ *
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
+ * SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ *
+ */
+package org.slf4j;
+
+import org.slf4j.impl.StaticBinder;
+import org.slf4j.impl.Util;
+
+// WARNING
+// WARNING Modifications MUST be made to the original file found at
+// WARNING $SLF4J_HOME/src/filtered-java/org/slf4j/MarkerFactory.java
+// WARNING
+
+
+/**
+ * MarkerFactory is a utility class producing [EMAIL PROTECTED] Marker}
instances as appropriate
+ * for the logging system currently in use.
+ *
+ * <p>This class is essentially implemented as a wrapper around an [EMAIL
PROTECTED] IMarkerFactory}
+ * instance bound at compile time.
+ *
+ * <p>Please note that all methods in this class are static.
+ *
+ * @author <a href="http://www.qos.ch/log4j/">Ceki Gülcü</a>
+ */
+public class MarkerFactory {
+ static IMarkerFactory markerFactory;
+ static StaticBinder staticBinder = new StaticBinder();
+
+ private MarkerFactory() {
+ }
+
+ //
+ // WARNING Do not modify copies but the original at
+ // $SLF4J_HOME/src/filtered-java/org/slf4j/
+ //
+ static {
+
+ try {
+ markerFactory = staticBinder.getMarkerFactory();
+ } catch (Exception e) {
+ // we should never get here
+ Util.reportFailure(
+ "Could not instantiate instance of class [" +
staticBinder.getMarkerFactoryClassStr() + "]",
+ e);
+ }
+ }
+
+ /**
+ * Return a Marker instnace as specified by the name parameter using the
+ * previously bound [EMAIL PROTECTED] IMarkerFactory}instance.
+ *
+ * @param name
+ * The name of the [EMAIL PROTECTED] Marker}object to return.
+ * @return marker
+ */
+ public static Marker getMarker(String name) {
+ return markerFactory.getMarker(name);
+ }
+
+ /**
+ * Return the [EMAIL PROTECTED] IMarkerFactory} instance in use.
+ *
+ * <p>
+ * Usually, the IMarkerFactory instance is bound with this class
+ * at compile time.
+ *
+ * @return the IMarkerFactory instance in use
+ */
+ public static IMarkerFactory getIMarkerFactory() {
+ return markerFactory;
+ }
+}
Added: nlog4j/trunk/src/java/org/slf4j/spi/MarkerFactoryBinder.java
==============================================================================
--- (empty file)
+++ nlog4j/trunk/src/java/org/slf4j/spi/MarkerFactoryBinder.java Sun Aug
28 16:47:32 2005
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2004-2005 SLF4J.ORG
+ * Copyright (c) 2004-2005 QOS.ch
+ *
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, and/or sell copies of the Software, and to permit persons
+ * to whom the Software is furnished to do so, provided that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the Software and that both the above copyright notice(s) and this
+ * permission notice appear in supporting documentation.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
+ * SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Except as contained in this notice, the name of a copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ *
+ */
+
+package org.slf4j.spi;
+
+import org.slf4j.IMarkerFactory;
+
+
+/**
+ * An internal interface which helps the static [EMAIL PROTECTED]
org.slf4j.MarkerFactory}
+ * class bind with the appropriate [EMAIL PROTECTED] IMarkerFactory} instance.
+ *
+ * @author <a href="http://www.qos.ch/log4j/">Ceki Gülcü</a>
+ */
+public interface MarkerFactoryBinder {
+
+ /**
+ * Return the instance of [EMAIL PROTECTED] IMarkerFactory} that
+ * [EMAIL PROTECTED] org.slf4j.MarkerFactory} class should bind to.
+ *
+ * @return the instance of [EMAIL PROTECTED] ILoggerFactory} that
+ * [EMAIL PROTECTED] org.slf4j.LoggerFactory} class should bind to.
+ */
+ public IMarkerFactory getMarkerFactory();
+
+ /**
+ * The String form of the [EMAIL PROTECTED] IMarkerFactory} object that this
+ * <code>MarkerFactoryBinder</code> instance is <em>intended</em> to return.
+ *
+ * <p>This method allows the developer to intterogate this binder's
intention
+ * which may be different from the [EMAIL PROTECTED] IMarkerFactory}
instance it is able to
+ * return. Such a discrepency should only occur in case of errors.
+ *
+ * @return the class name of the intended [EMAIL PROTECTED] IMarkerFactory}
instance
+ */
+ public String getMarkerFactoryClassStr();
+}
_______________________________________________
nlog4j-dev mailing list
[email protected]
http://slf4j.org/mailman/listinfo/nlog4j-dev