[slf4j-dev] svn commit: r428 - in slf4j/trunk: . src/filtered-java/org/slf4j/impl src/java/org/slf4j src/java/org/slf4j/impl tests tests/src/java/org/slf4j/impl
ceki at slf4j.org
ceki at slf4j.org
Mon Nov 21 14:22:42 CET 2005
Author: ceki
Date: Mon Nov 21 14:22:39 2005
New Revision: 428
Added:
slf4j/trunk/src/filtered-java/org/slf4j/impl/StaticLoggerBinder.java
- copied, changed from r424, slf4j/trunk/src/filtered-java/org/slf4j/impl/StaticBinder.java
slf4j/trunk/src/filtered-java/org/slf4j/impl/StaticMarkerBinder.java
slf4j/trunk/src/java/org/slf4j/impl/MNOPLogger.java
slf4j/trunk/src/java/org/slf4j/impl/MNOPLoggerFactory.java
slf4j/trunk/src/java/org/slf4j/impl/MSimpleLogger.java
slf4j/trunk/src/java/org/slf4j/impl/MSimpleLoggerFactory.java
slf4j/trunk/tests/src/java/org/slf4j/impl/MLogger.java
Removed:
slf4j/trunk/src/filtered-java/org/slf4j/impl/StaticBinder.java
Modified:
slf4j/trunk/build.xml
slf4j/trunk/src/java/org/slf4j/LoggerFactory.java
slf4j/trunk/src/java/org/slf4j/MarkerFactory.java
slf4j/trunk/src/java/org/slf4j/impl/NOPLogger.java
slf4j/trunk/src/java/org/slf4j/impl/SimpleLogger.java
slf4j/trunk/tests/build.xml
slf4j/trunk/tests/src/java/org/slf4j/impl/XLogger.java
Log:
Separation between Marker binding and Logger binding allowing us to build smaller jar files
Modified: slf4j/trunk/build.xml
==============================================================================
--- slf4j/trunk/build.xml (original)
+++ slf4j/trunk/build.xml Mon Nov 21 14:22:39 2005
@@ -25,6 +25,7 @@
These are some of the targets supported by this ANT build scpript:
slf4j-nop.jar - build the jar file of the same name.
+ slf4j-mnop.jar - build the jar file of the same name.
slf4j-simple.jar - build the jar file 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.
@@ -97,6 +98,17 @@
</target>
+ <target name="compile.jar" depends="init">
+ <antcall target="compile-IMPL">
+ <param name="IMPL" value="Simple" />
+ <param name="IMPL.CLASSPATH" value="regular.classpath" />
+ </antcall>
+
+ <jar jarfile="compile.jar" basedir="${tmp.javac.dest}"
+ includes="${SLF4J_STEM}/impl/Static*Binder.class">
+ </jar>
+ </target>
+
<!-- =================================================================== -->
<!-- Generic target that can build NOP, Simple and JDK14 implementations -->
<!-- as specified by the "jar-name" and "impl" parameters. -->
@@ -133,11 +145,40 @@
</target>
+ <!-- ====================================================================== -->
+ <!-- Generic target that can build NOP, Simple, log4j and JDK14 -->
+ <!-- implementations as specified by the "jar-name" and "impl" parameters. -->
+ <!-- ====================================================================== -->
+ <target name="slf4j-IMPL.jar" depends="init">
+
+ <antcall target="compile-IMPL">
+ <param name="IMPL" value="${IMPL}" />
+ </antcall>
+
+ <jar jarfile="${jar-name}" basedir="${tmp.javac.dest}" includes="${SLF4J_STEM}/Constants.class,
+ ${SLF4J_STEM}/ILoggerFactory.class,
+ ${SLF4J_STEM}/Logger*.class,
+ ${SLF4J_STEM}/spi/LoggerFactoryBinder.class,
+ ${SLF4J_STEM}/impl/MessageFormatter.class,
+ ${SLF4J_STEM}/impl/Util.class,
+ ${SLF4J_STEM}/impl/SystemPropBinder.class,
+ ${SLF4J_STEM}/impl/StaticLoggerBinder.class,
+ ${SLF4J_STEM}/impl/${IMPL}*.class">
+ <manifest>
+ <section name="org/slf4j/">
+ <attribute name="Implementation-Title" value="${IMPL} implementation" />
+ <attribute name="Implementation-Version" value="${version}" />
+ <attribute name="Implementation-Vendor" value="SLF4J.ORG" />
+ </section>
+ </manifest>
+ </jar>
+ </target>
+
<!-- =================================================================== -->
- <!-- Generic target that can build NOP, Simple and JDK14 implementations -->
- <!-- as specified by the "jar-name" and "impl" parameters. -->
+ <!-- Generic target that can build MNOP, MSimple implementations as -->
+ <!-- specified by the "jar-name" and "impl" parameters. -->
<!-- =================================================================== -->
- <target name="slf4j-IMPL.jar" depends="init">
+ <target name="slf4j-MIMPL.jar" depends="init">
<antcall target="compile-IMPL">
<param name="IMPL" value="${IMPL}" />
@@ -223,7 +264,7 @@
</target>
- <target name="jar" depends="slf4j-nop.jar, jcl-over-slf4j.jar, slf4j-log4j12.jar, slf4j-log4j13.jar,
+ <target name="jar" depends="compile.jar, slf4j-nop.jar, jcl-over-slf4j.jar, slf4j-log4j12.jar, slf4j-log4j13.jar,
slf4j-simple.jar, slf4j-jdk14.jar" />
<!-- Build Javadoc -->
Copied: slf4j/trunk/src/filtered-java/org/slf4j/impl/StaticLoggerBinder.java (from r424, slf4j/trunk/src/filtered-java/org/slf4j/impl/StaticBinder.java)
==============================================================================
--- slf4j/trunk/src/filtered-java/org/slf4j/impl/StaticBinder.java (original)
+++ slf4j/trunk/src/filtered-java/org/slf4j/impl/StaticLoggerBinder.java Mon Nov 21 14:22:39 2005
@@ -50,12 +50,12 @@
*
* @author <a href="http://www.qos.ch/log4j/">Ceki Gülcü</a>
*/
-public class StaticBinder implements LoggerFactoryBinder, MarkerFactoryBinder {
+public class StaticLoggerBinder implements LoggerFactoryBinder {
/**
* The unique instance of this class.
*/
- public static final StaticBinder SINGLETON = new StaticBinder();
+ public static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder();
// Note: @IMPL@ gets substituted at build time by an appropriate Ant task
private static final String loggerFactoryClassStr ="org.slf4j.impl. at IMPL@LoggerFactory";
@@ -64,7 +64,7 @@
*/
private final ILoggerFactory loggerFactory;
- private StaticBinder() {
+ private StaticLoggerBinder() {
// Note: @IMPL@ gets substituted at build time by an appropriate Ant task
loggerFactory = new org.slf4j.impl. at IMPL@LoggerFactory();
}
@@ -76,22 +76,4 @@
public String getLoggerFactoryClassStr() {
return loggerFactoryClassStr;
}
-
- /**
- * Currently this method always returns an instance of
- * {@link BasicMarkerFactory}.
- */
- public IMarkerFactory getMarkerFactory() {
- return new BasicMarkerFactory();
- }
-
- /**
- * Currrently, this method returns the class name of
- * {@link BasicMarkerFactory}.
- */
- public String getMarkerFactoryClassStr() {
- return BasicMarkerFactory.class.getName();
- }
-
-
}
Added: slf4j/trunk/src/filtered-java/org/slf4j/impl/StaticMarkerBinder.java
==============================================================================
--- (empty file)
+++ slf4j/trunk/src/filtered-java/org/slf4j/impl/StaticMarkerBinder.java Mon Nov 21 14:22:39 2005
@@ -0,0 +1,77 @@
+/*
+ * 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.impl;
+
+import org.slf4j.LoggerFactory;
+import org.slf4j.MarkerFactory;
+import org.slf4j.ILoggerFactory;
+import org.slf4j.IMarkerFactory;
+import org.slf4j.spi.LoggerFactoryBinder;
+import org.slf4j.spi.MarkerFactoryBinder;
+
+/**
+ *
+ * The binding of {@link MarkerFactory} class with an actual instance of
+ * {@link IMarkerFactory} is performed using information returned by this class.
+ *
+ * @author <a href="http://www.qos.ch/log4j/">Ceki Gülcü</a>
+ */
+public class StaticMarkerBinder implements MarkerFactoryBinder {
+
+ /**
+ * The unique instance of this class.
+ */
+ public static final StaticMarkerBinder SINGLETON = new StaticMarkerBinder();
+
+ private StaticMarkerBinder() {
+ }
+
+ /**
+ * Currently this method always returns an instance of
+ * {@link BasicMarkerFactory}.
+ */
+ public IMarkerFactory getMarkerFactory() {
+ return new BasicMarkerFactory();
+ }
+
+ /**
+ * Currrently, this method returns the class name of
+ * {@link BasicMarkerFactory}.
+ */
+ public String getMarkerFactoryClassStr() {
+ return BasicMarkerFactory.class.getName();
+ }
+
+
+}
Modified: slf4j/trunk/src/java/org/slf4j/LoggerFactory.java
==============================================================================
--- slf4j/trunk/src/java/org/slf4j/LoggerFactory.java (original)
+++ slf4j/trunk/src/java/org/slf4j/LoggerFactory.java Mon Nov 21 14:22:39 2005
@@ -33,7 +33,7 @@
package org.slf4j;
-import org.slf4j.impl.StaticBinder;
+import org.slf4j.impl.StaticLoggerBinder;
import org.slf4j.impl.SystemPropBinder;
import org.slf4j.impl.Util;
@@ -79,11 +79,11 @@
+ "] adapter factory from system properties.");
} else {
try { // otherwise bind statically
- loggerFactory = StaticBinder.SINGLETON.getLoggerFactory();
+ loggerFactory = StaticLoggerBinder.SINGLETON.getLoggerFactory();
} catch (Exception e) {
// we should never get here
Util.reportFailure(
- "Could not instantiate instance of class [" + StaticBinder.SINGLETON.getLoggerFactoryClassStr() + "]",
+ "Could not instantiate instance of class [" + StaticLoggerBinder.SINGLETON.getLoggerFactoryClassStr() + "]",
e);
}
}
Modified: slf4j/trunk/src/java/org/slf4j/MarkerFactory.java
==============================================================================
--- slf4j/trunk/src/java/org/slf4j/MarkerFactory.java (original)
+++ slf4j/trunk/src/java/org/slf4j/MarkerFactory.java Mon Nov 21 14:22:39 2005
@@ -31,7 +31,7 @@
*/
package org.slf4j;
-import org.slf4j.impl.StaticBinder;
+import org.slf4j.impl.StaticMarkerBinder;
import org.slf4j.impl.Util;
// WARNING
@@ -65,11 +65,11 @@
static {
try {
- markerFactory = StaticBinder.SINGLETON.getMarkerFactory();
+ markerFactory = StaticMarkerBinder.SINGLETON.getMarkerFactory();
} catch (Exception e) {
// we should never get here
Util.reportFailure("Could not instantiate instance of class ["
- + StaticBinder.SINGLETON.getMarkerFactoryClassStr() + "]", e);
+ + StaticMarkerBinder.SINGLETON.getMarkerFactoryClassStr() + "]", e);
}
}
Added: slf4j/trunk/src/java/org/slf4j/impl/MNOPLogger.java
==============================================================================
--- (empty file)
+++ slf4j/trunk/src/java/org/slf4j/impl/MNOPLogger.java Mon Nov 21 14:22:39 2005
@@ -0,0 +1,153 @@
+/*
+ * 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.impl;
+
+import org.slf4j.Logger;
+import org.slf4j.Marker;
+import org.slf4j.MarkingLogger;
+
+
+/**
+ * A direct NOP (no operation) implementation of {@link Logger}.
+ *
+ * @author <a href="http://www.qos.ch/log4j/">Ceki Gülcü</a>
+ */
+public final class MNOPLogger extends NOPLogger implements MarkingLogger {
+ /**
+ * The unique instance of MNOPLogger.
+ */
+ public static final MNOPLogger MNOP_LOGGER = new MNOPLogger();
+
+ /**
+ * There is no point in creating multiple instances of NullLogger,
+ * hence the private access modifier.
+ */
+ private MNOPLogger() {
+ }
+
+ /**
+ * Always returns the string value "MNOP".
+ */
+ public String getName() {
+ return "MNOP";
+ }
+
+
+ /** A NOP implementation. */
+ public void debug(Marker marker, String msg) {
+ }
+
+ /** A NOP implementation. */
+ public void debug(Marker marker, String format, Object arg) {
+ }
+
+ /** A NOP implementation. */
+ public void debug(Marker marker, String format, Object arg1, Object arg2) {
+ }
+
+ /** A NOP implementation. */
+ public void debug(Marker marker, String msg, Throwable t) {
+ }
+
+ /**
+ * Always returns false.
+ * @return always false
+ */
+ public boolean isDebugEnabled(Marker marker) {
+ return false;
+ }
+
+
+ /** A NOP implementation. */
+ public void info(Marker marker, String msg) {
+ }
+
+ /** A NOP implementation. */
+ public void info(Marker marker, String format, Object arg) {
+ }
+
+ /** A NOP implementation. */
+ public void info(Marker marker, String format, Object arg1, Object arg2) {
+ }
+
+ /** A NOP implementation. */
+ public void info(Marker marker, String msg, Throwable t) {
+ }
+
+ public boolean isInfoEnabled(Marker marker) {
+ return false;
+ }
+
+ /** A NOP implementation. */
+ public void warn(Marker marker, String msg) {
+ }
+
+ /** A NOP implementation. */
+ public void warn(Marker marker, String format, Object arg) {
+ }
+
+ /** A NOP implementation. */
+ public void warn(Marker marker, String format, Object arg1, Object arg2) {
+ }
+
+ /** A NOP implementation. */
+ public void warn(Marker marker, String msg, Throwable t) {
+ }
+
+ /** Always false. */
+ public boolean isWarnEnabled(Marker marker) {
+ return false;
+ }
+
+ /** A NOP implementation. */
+ public void error(Marker marker, String msg) {
+ }
+
+ /** A NOP implementation. */
+ public void error(Marker marker, String format, Object arg) {
+ }
+
+ /** A NOP implementation. */
+ public final void error(Marker marker, String format, Object arg1, Object arg2) {
+ }
+
+ /** A NOP implementation. */
+ public void error(Marker marker, String msg, Throwable t) {
+ }
+
+ /** A NOP implementation. */
+ public final boolean isErrorEnabled(Marker marker) {
+ return false;
+ }
+}
Added: slf4j/trunk/src/java/org/slf4j/impl/MNOPLoggerFactory.java
==============================================================================
--- (empty file)
+++ slf4j/trunk/src/java/org/slf4j/impl/MNOPLoggerFactory.java Mon Nov 21 14:22:39 2005
@@ -0,0 +1,57 @@
+/*
+ * 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.impl;
+
+import org.slf4j.Logger;
+import org.slf4j.ILoggerFactory;
+
+
+/**
+ * NOPLoggerFactory is an trivial implementation of {@link
+ * ILoggerFactory} which always returns the unique instance of
+ * NOPLogger.
+ *
+ * @author Ceki Gulcu
+ */
+public class MNOPLoggerFactory implements ILoggerFactory {
+
+ public MNOPLoggerFactory() {
+ // nothing to do
+ }
+
+ public Logger getLogger(String name) {
+ return MNOPLogger.MNOP_LOGGER;
+ }
+
+}
Added: slf4j/trunk/src/java/org/slf4j/impl/MSimpleLogger.java
==============================================================================
--- (empty file)
+++ slf4j/trunk/src/java/org/slf4j/impl/MSimpleLogger.java Mon Nov 21 14:22:39 2005
@@ -0,0 +1,382 @@
+/*
+ * 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.impl;
+
+import org.slf4j.Marker;
+import org.slf4j.MarkingLogger;
+
+
+/**
+ * A simple (and direct) implementation that logs messages of level
+ * INFO or higher on the console (<code>System.out<code>).
+ *
+ * <p>The output includes the relative time in milliseconds, thread
+ * name, the level, logger name, and the message followed by the line
+ * separator for the host. In log4j terms it amounts to the "%r [%t]
+ * %level %logger - %m%n" pattern. *</p>
+ *
+ * <p>Sample output follows.</p>
+ * <pre>
+176 [main] INFO examples.Sort - Populating an array of 2 elements in reverse order.
+225 [main] INFO examples.SortAlgo - Entered the sort method.
+304 [main] INFO examples.SortAlgo - Dump of interger array:
+317 [main] INFO examples.SortAlgo - Element [0] = 0
+331 [main] INFO examples.SortAlgo - Element [1] = 1
+343 [main] INFO examples.Sort - The next log statement should be an error message.
+346 [main] ERROR examples.SortAlgo - Tried to dump an uninitialized array.
+ at org.log4j.examples.SortAlgo.dump(SortAlgo.java:58)
+ at org.log4j.examples.Sort.main(Sort.java:64)
+467 [main] INFO examples.Sort - Exiting main method.
+</pre>
+ *
+ * @author <a href="http://www.qos.ch/log4j/">Ceki Gülcü</a>
+ */
+public class MSimpleLogger implements MarkingLogger {
+ /**
+ * Mark the time when this class gets loaded into memory.
+ */
+ private static long startTime = System.currentTimeMillis();
+ public static final String LINE_SEPARATOR =
+ System.getProperty("line.separator");
+ private static String INFO_STR = "INFO";
+ private static String WARN_STR = "WARN";
+ private static String ERROR_STR = "ERROR";
+ String name;
+
+ /**
+ * Package access allows only {@link SimpleLoggerFactory} to instantiate
+ * SimpleLogger instances.
+ */
+ MSimpleLogger(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+ /**
+ * Always returns false.
+ * @return always false
+ */
+ public boolean isDebugEnabled() {
+ return false;
+ }
+
+ /**
+ * Always returns false.
+ * @return always false
+ */
+ public boolean isDebugEnabled(Marker marker) {
+ return false;
+ }
+
+ /**
+ * A NOP implementation, as this logger is permanently disabled for
+ * the DEBUG level.
+ */
+ public void debug(String msg) {
+ // NOP
+ }
+
+ /**
+ * A NOP implementation, as this logger is permanently disabled for
+ * the DEBUG level.
+ */
+ public void debug(String format, Object param1) {
+ // NOP
+ }
+
+ /**
+ * A NOP implementation, as this logger is permanently disabled for
+ * the DEBUG level.
+ */
+ public void debug(String format, Object param1, Object param2) {
+ // NOP
+ }
+
+ /**
+ * A NOP implementation, as this logger is permanently disabled for
+ * the DEBUG level.
+ */
+ public void debug(String msg, Throwable t) {
+ // NOP
+ }
+
+ public void debug(Marker marker, String msg) {
+ }
+
+ public void debug(Marker marker, String format, Object arg) {
+ debug(format, arg);
+ }
+
+ public void debug(Marker marker, String format, Object arg1, Object arg2) {
+ debug(format, arg1, arg2);
+ }
+
+ public void debug(Marker marker, String msg, Throwable t) {
+ debug(msg, t);
+ }
+
+ /**
+ * This is our internal implementation for logging regular (non-parameterized)
+ * log messages.
+ *
+ * @param level
+ * @param message
+ * @param t
+ */
+ private void log(String level, String message, Throwable t) {
+ StringBuffer buf = new StringBuffer();
+
+ long millis = System.currentTimeMillis();
+ buf.append(millis - startTime);
+
+ buf.append(" [");
+ buf.append(Thread.currentThread().getName());
+ buf.append("] ");
+
+ buf.append(level);
+ buf.append(" ");
+
+ buf.append(name);
+ buf.append(" - ");
+
+ buf.append(message);
+
+ buf.append(LINE_SEPARATOR);
+
+ System.out.print(buf.toString());
+ if (t != null) {
+ t.printStackTrace(System.out);
+ }
+ System.out.flush();
+ }
+
+ /**
+ * For formatted messages, first substitute arguments and then log.
+ *
+ * @param level
+ * @param format
+ * @param param1
+ * @param param2
+ */
+ private void formatAndLog(
+ String level, String format, Object arg1, Object arg2) {
+ String message = MessageFormatter.format(format, arg1, arg2);
+ log(level, message, null);
+ }
+
+ /**
+ * Always returns true.
+ */
+ public boolean isInfoEnabled() {
+ return true;
+ }
+
+ /**
+ * Always returns true.
+ */
+ public boolean isInfoEnabled(Marker marker) {
+ return true;
+ }
+
+ /**
+ * A simple implementation which always logs messages of level INFO according
+ * to the format outlined above.
+ */
+ public void info(String msg) {
+ log(INFO_STR, msg, null);
+ }
+
+ /**
+ * Perform single parameter substituion before logging the message of level
+ * INFO according to the format outlined above.
+ */
+ public void info(String format, Object arg) {
+ formatAndLog(INFO_STR, format, arg, null);
+ }
+
+ /**
+ * Perform double parameter substituion before logging the message of level
+ * INFO according to the format outlined above.
+ */
+ public void info(String format, Object arg1, Object arg2) {
+ formatAndLog(INFO_STR, format, arg1, arg2);
+ }
+
+ /**
+ * Log a message of level INFO, including an exception.
+ */
+ public void info(String msg, Throwable t) {
+ log(INFO_STR, msg.toString(), t);
+ }
+
+ public void info(Marker marker, String msg) {
+ info(msg);
+ }
+
+ public void info(Marker marker, String format, Object arg) {
+ info(format, arg);
+ }
+
+ public void info(Marker marker, String format, Object arg1, Object arg2) {
+ info(format, arg1, arg2);
+ }
+
+ public void info(Marker marker, String msg, Throwable t) {
+ info(msg, t);
+ }
+
+ /**
+ * Always returns true.
+ */
+ public boolean isWarnEnabled() {
+ return true;
+ }
+
+ /**
+ * Always returns true.
+ */
+ public boolean isWarnEnabled(Marker marker) {
+ return true;
+ }
+
+ /**
+ * A simple implementation which always logs messages of level WARN according
+ * to the format outlined above.
+ */
+ public void warn(String msg) {
+ log(WARN_STR, msg.toString(), null);
+ }
+
+ /**
+ * Perform single parameter substituion before logging the message of level
+ * WARN according to the format outlined above.
+ */
+ public void warn(String format, Object arg) {
+ formatAndLog(WARN_STR, format, arg, null);
+ }
+
+ /**
+ * Perform double parameter substituion before logging the message of level
+ * WARN according to the format outlined above.
+ */
+ public void warn(String format, Object arg1, Object arg2) {
+ formatAndLog(WARN_STR, format, arg1, arg2);
+ }
+
+ /**
+ * Log a message of level WARN, including an exception.
+ */
+ public void warn(String msg, Throwable t) {
+ log(WARN_STR, msg.toString(), t);
+ }
+
+ public void warn(Marker marker, String msg) {
+ warn(msg);
+ }
+
+ public void warn(Marker marker, String format, Object arg) {
+ warn(format, arg);
+ }
+
+ public void warn(Marker marker, String format, Object arg1, Object arg2) {
+ warn(format, arg1, arg2);
+ }
+
+ public void warn(Marker marker, String msg, Throwable t) {
+ warn(msg, t);
+ }
+
+ /**
+ * Always returns true.
+ */
+ public boolean isErrorEnabled() {
+ return true;
+ }
+
+ /**
+ * Always returns true.
+ */
+ public boolean isErrorEnabled(Marker marker) {
+ return true;
+ }
+
+ /**
+ * A simple implementation which always logs messages of level ERROR acoording
+ * to the format outlined above.
+ */
+ public void error(String msg) {
+ log(ERROR_STR, msg.toString(), null);
+ }
+
+ /**
+ * Perform single parameter substituion before logging the message of level
+ * ERROR according to the format outlined above.
+ */
+ public void error(String format, Object arg) {
+ formatAndLog(ERROR_STR, format, arg, null);
+ }
+
+ /**
+ * Perform double parameter substituion before logging the message of level
+ * ERROR according to the format outlined above.
+ */
+ public void error(String format, Object arg1, Object arg2) {
+ formatAndLog(ERROR_STR, format, arg1, arg2);
+ }
+
+ /**
+ * Log a message of level ERROR, including an exception.
+ */
+ public void error(String msg, Throwable t) {
+ log(ERROR_STR, msg.toString(), t);
+ }
+
+ public void error(Marker marker, String msg) {
+ error(msg);
+ }
+
+ public void error(Marker marker, String format, Object arg) {
+ error(format, arg);
+ }
+
+ public void error(Marker marker, String format, Object arg1, Object arg2) {
+ error(format, arg1, arg2);
+ }
+
+ public void error(Marker marker, String msg, Throwable t) {
+ error(msg, t);
+ }
+}
Added: slf4j/trunk/src/java/org/slf4j/impl/MSimpleLoggerFactory.java
==============================================================================
--- (empty file)
+++ slf4j/trunk/src/java/org/slf4j/impl/MSimpleLoggerFactory.java Mon Nov 21 14:22:39 2005
@@ -0,0 +1,69 @@
+/*
+ * 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.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.ILoggerFactory;
+
+
+/**
+ * An implementation of {@link ILoggerFactory} which always returns
+ * {@link MSimpleLogger} instances.
+ *
+ * @author Ceki Gülcü
+ */
+public class MSimpleLoggerFactory implements ILoggerFactory {
+
+ Map map;
+
+ public MSimpleLoggerFactory() {
+ map = new HashMap();
+ }
+
+
+ /**
+ * Return an appropriate {@link MSimpleLogger} instance by name.
+ */
+ public Logger getLogger(String name) {
+ Logger ulogger = (Logger) map.get(name);
+ if(ulogger == null) {
+ ulogger = new MSimpleLogger(name);
+ map.put(name, ulogger);
+ }
+ return ulogger;
+ }
+}
Modified: slf4j/trunk/src/java/org/slf4j/impl/NOPLogger.java
==============================================================================
--- slf4j/trunk/src/java/org/slf4j/impl/NOPLogger.java (original)
+++ slf4j/trunk/src/java/org/slf4j/impl/NOPLogger.java Mon Nov 21 14:22:39 2005
@@ -34,8 +34,6 @@
package org.slf4j.impl;
import org.slf4j.Logger;
-import org.slf4j.Marker;
-import org.slf4j.MarkingLogger;
/**
@@ -43,17 +41,17 @@
*
* @author <a href="http://www.qos.ch/log4j/">Ceki Gülcü</a>
*/
-public final class NOPLogger implements MarkingLogger {
+public class NOPLogger implements Logger {
/**
* The unique instance of NOPLogger.
*/
public static final NOPLogger NOP_LOGGER = new NOPLogger();
/**
- * There is no point in creating multiple instances of NullLogger,
- * hence the private access modifier.
+ * There is no point in creating multiple instances of NOPLOgger,
+ * except by derived classes, hence the protected access for the constructor.
*/
- private NOPLogger() {
+ protected NOPLogger() {
}
/**
@@ -67,17 +65,17 @@
* Always returns false.
* @return always false
*/
- public boolean isDebugEnabled() {
+ final public boolean isDebugEnabled() {
return false;
}
/** A NOP implementation. */
- public void debug(String msg) {
+ final public void debug(String msg) {
// NOP
}
/** A NOP implementation. */
- public void debug(String format, Object arg) {
+ final public void debug(String format, Object arg) {
// NOP
}
@@ -87,7 +85,7 @@
}
/** A NOP implementation. */
- public void debug(String msg, Throwable t) {
+ final public void debug(String msg, Throwable t) {
// NOP
}
@@ -95,167 +93,84 @@
* Always returns false.
* @return always false
*/
- public boolean isInfoEnabled() {
+ final public boolean isInfoEnabled() {
// NOP
return false;
}
- /** A NOP implementation. */
- public void debug(Marker marker, String msg) {
- }
-
- /** A NOP implementation. */
- public void debug(Marker marker, String format, Object arg) {
- }
-
- /** A NOP implementation. */
- public void debug(Marker marker, String format, Object arg1, Object arg2) {
- }
/** A NOP implementation. */
- public void debug(Marker marker, String msg, Throwable t) {
- }
-
- /**
- * Always returns false.
- * @return always false
- */
- public boolean isDebugEnabled(Marker marker) {
- return false;
- }
-
- /** A NOP implementation. */
- public void info(String msg) {
+ final public void info(String msg) {
// NOP
}
/** A NOP implementation. */
- public void info(String format, Object arg1) {
+ final public void info(String format, Object arg1) {
// NOP
}
/** A NOP implementation. */
- public void info(String format, Object arg1, Object arg2) {
+ final public void info(String format, Object arg1, Object arg2) {
// NOP
}
/** A NOP implementation. */
- public void info(String msg, Throwable t) {
+ final public void info(String msg, Throwable t) {
// NOP
}
- /** A NOP implementation. */
- public void info(Marker marker, String msg) {
- }
-
- /** A NOP implementation. */
- public void info(Marker marker, String format, Object arg) {
- }
-
- /** A NOP implementation. */
- public void info(Marker marker, String format, Object arg1, Object arg2) {
- }
-
- /** A NOP implementation. */
- public void info(Marker marker, String msg, Throwable t) {
- }
-
- public boolean isInfoEnabled(Marker marker) {
- return false;
- }
/**
* Always returns false.
* @return always false
*/
- public boolean isWarnEnabled() {
+ final public boolean isWarnEnabled() {
return false;
}
/** A NOP implementation. */
- public void warn(String msg) {
+ final public void warn(String msg) {
// NOP
}
/** A NOP implementation. */
- public void warn(String format, Object arg1) {
+ final public void warn(String format, Object arg1) {
// NOP
}
/** A NOP implementation. */
- public void warn(String format, Object arg1, Object arg2) {
+ final public void warn(String format, Object arg1, Object arg2) {
// NOP
}
/** A NOP implementation. */
- public void warn(String msg, Throwable t) {
+ final public void warn(String msg, Throwable t) {
// NOP
}
- /** A NOP implementation. */
- public void warn(Marker marker, String msg) {
- }
-
- /** A NOP implementation. */
- public void warn(Marker marker, String format, Object arg) {
- }
-
- /** A NOP implementation. */
- public void warn(Marker marker, String format, Object arg1, Object arg2) {
- }
-
- /** A NOP implementation. */
- public void warn(Marker marker, String msg, Throwable t) {
- }
-
- /** Always false. */
- public boolean isWarnEnabled(Marker marker) {
- return false;
- }
/** A NOP implementation. */
- public boolean isErrorEnabled() {
+ final public boolean isErrorEnabled() {
return false;
}
/** A NOP implementation. */
- public void error(String msg) {
+ final public void error(String msg) {
// NOP
}
/** A NOP implementation. */
- public void error(String format, Object arg1) {
+ final public void error(String format, Object arg1) {
// NOP
}
/** A NOP implementation. */
- public void error(String format, Object arg1, Object arg2) {
+ final public void error(String format, Object arg1, Object arg2) {
// NOP
}
/** A NOP implementation. */
- public void error(String msg, Throwable t) {
+ final public void error(String msg, Throwable t) {
// NOP
}
-
- /** A NOP implementation. */
- public void error(Marker marker, String msg) {
- }
-
- /** A NOP implementation. */
- public void error(Marker marker, String format, Object arg) {
- }
-
- /** A NOP implementation. */
- public final void error(Marker marker, String format, Object arg1, Object arg2) {
- }
-
- /** A NOP implementation. */
- public void error(Marker marker, String msg, Throwable t) {
- }
-
- /** A NOP implementation. */
- public final boolean isErrorEnabled(Marker marker) {
- return false;
- }
}
Modified: slf4j/trunk/src/java/org/slf4j/impl/SimpleLogger.java
==============================================================================
--- slf4j/trunk/src/java/org/slf4j/impl/SimpleLogger.java (original)
+++ slf4j/trunk/src/java/org/slf4j/impl/SimpleLogger.java Mon Nov 21 14:22:39 2005
@@ -33,8 +33,7 @@
package org.slf4j.impl;
-import org.slf4j.Marker;
-import org.slf4j.MarkingLogger;
+import org.slf4j.Logger;
/**
@@ -62,7 +61,7 @@
*
* @author <a href="http://www.qos.ch/log4j/">Ceki Gülcü</a>
*/
-public class SimpleLogger implements MarkingLogger {
+public class SimpleLogger implements Logger {
/**
* Mark the time when this class gets loaded into memory.
*/
@@ -94,14 +93,6 @@
}
/**
- * Always returns false.
- * @return always false
- */
- public boolean isDebugEnabled(Marker marker) {
- return false;
- }
-
- /**
* A NOP implementation, as this logger is permanently disabled for
* the DEBUG level.
*/
@@ -133,21 +124,6 @@
// NOP
}
- public void debug(Marker marker, String msg) {
- }
-
- public void debug(Marker marker, String format, Object arg) {
- debug(format, arg);
- }
-
- public void debug(Marker marker, String format, Object arg1, Object arg2) {
- debug(format, arg1, arg2);
- }
-
- public void debug(Marker marker, String msg, Throwable t) {
- debug(msg, t);
- }
-
/**
* This is our internal implementation for logging regular (non-parameterized)
* log messages.
@@ -205,13 +181,6 @@
}
/**
- * Always returns true.
- */
- public boolean isInfoEnabled(Marker marker) {
- return true;
- }
-
- /**
* A simple implementation which always logs messages of level INFO according
* to the format outlined above.
*/
@@ -242,22 +211,6 @@
log(INFO_STR, msg.toString(), t);
}
- public void info(Marker marker, String msg) {
- info(msg);
- }
-
- public void info(Marker marker, String format, Object arg) {
- info(format, arg);
- }
-
- public void info(Marker marker, String format, Object arg1, Object arg2) {
- info(format, arg1, arg2);
- }
-
- public void info(Marker marker, String msg, Throwable t) {
- info(msg, t);
- }
-
/**
* Always returns true.
*/
@@ -266,13 +219,6 @@
}
/**
- * Always returns true.
- */
- public boolean isWarnEnabled(Marker marker) {
- return true;
- }
-
- /**
* A simple implementation which always logs messages of level WARN according
* to the format outlined above.
*/
@@ -303,22 +249,6 @@
log(WARN_STR, msg.toString(), t);
}
- public void warn(Marker marker, String msg) {
- warn(msg);
- }
-
- public void warn(Marker marker, String format, Object arg) {
- warn(format, arg);
- }
-
- public void warn(Marker marker, String format, Object arg1, Object arg2) {
- warn(format, arg1, arg2);
- }
-
- public void warn(Marker marker, String msg, Throwable t) {
- warn(msg, t);
- }
-
/**
* Always returns true.
*/
@@ -327,13 +257,6 @@
}
/**
- * Always returns true.
- */
- public boolean isErrorEnabled(Marker marker) {
- return true;
- }
-
- /**
* A simple implementation which always logs messages of level ERROR acoording
* to the format outlined above.
*/
@@ -364,19 +287,4 @@
log(ERROR_STR, msg.toString(), t);
}
- public void error(Marker marker, String msg) {
- error(msg);
- }
-
- public void error(Marker marker, String format, Object arg) {
- error(format, arg);
- }
-
- public void error(Marker marker, String format, Object arg1, Object arg2) {
- error(format, arg1, arg2);
- }
-
- public void error(Marker marker, String msg, Throwable t) {
- error(msg, t);
- }
}
Modified: slf4j/trunk/tests/build.xml
==============================================================================
--- slf4j/trunk/tests/build.xml (original)
+++ slf4j/trunk/tests/build.xml Mon Nov 21 14:22:39 2005
@@ -14,8 +14,7 @@
<path id="compile.classpath">
<path refid="basic.classpath" />
- <pathelement location="../slf4j-simple.jar" />
- <pathelement location="../jcl104-over-slf4j.jar" />
+ <pathelement location="../classes/" />
</path>
<path id="nop.classpath">
Added: slf4j/trunk/tests/src/java/org/slf4j/impl/MLogger.java
==============================================================================
--- (empty file)
+++ slf4j/trunk/tests/src/java/org/slf4j/impl/MLogger.java Mon Nov 21 14:22:39 2005
@@ -0,0 +1,303 @@
+/*
+ * 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.impl;
+
+import org.slf4j.Logger;
+
+
+/**
+ * A NOP Logger implementation.
+ */
+public class MLogger implements Logger {
+
+ public final static MLogger M_LOGGER = new MLogger();
+
+
+ private MLogger() { }
+
+
+ public boolean isDebugEnabled() { return false; }
+
+ public void debug(String msg) {
+ }
+
+ public void debug(String parameterizedMsg, Object arg) { }
+
+ public void debug(String parameterizedMsg, Object arg1, Object arg2) { }
+
+ public void debug(String msg, Throwable t) { }
+
+ public boolean isInfoEnabled() { return false;
+ }
+
+ public void info(String msg) {
+ // NOP
+ }
+
+ public void info(String format, Object arg) {
+ // NOP
+ }
+
+ public void info(String format, Object arg1, Object arg2) {
+ // NOP
+ }
+
+ public void info(String msg, Throwable t) {
+ // NOP
+ }
+
+ public boolean isWarnEnabled() {
+ return false;
+ }
+
+ public void warn(String msg) {
+ // NOP
+ }
+
+ public void warn(String format, Object arg) {
+ // NOP
+ }
+
+ public void warn(String format, Object arg1, Object arg2) {
+ // NOP
+ }
+
+ public void warn(String msg, Throwable t) {
+ }
+
+ public boolean isErrorEnabled() {
+ return false;
+ }
+
+ public void error(String msg) {
+ }
+
+ public void error(String format, Object arg) {
+ }
+
+ public void error(String format, Object arg1, Object arg2) {
+ }
+
+ public void error(String msg, Throwable t) {
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.slf4j.Logger#getName()
+ */
+ public String getName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#isDebugEnabled(org.slf4j.Marker)
+// */
+// public boolean isDebugEnabled(Marker marker) {
+// // TODO Auto-generated method stub
+// return false;
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String)
+// */
+// public void debug(Marker marker, String msg) {
+// // TODO Auto-generated method stub
+//
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String, java.lang.Object)
+// */
+// public void debug(Marker marker, String format, Object arg) {
+// // TODO Auto-generated method stub
+//
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object)
+// */
+// public void debug(Marker marker, String format, Object arg1, Object arg2) {
+// // TODO Auto-generated method stub
+//
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String, java.lang.Throwable)
+// */
+// public void debug(Marker marker, String msg, Throwable t) {
+// // TODO Auto-generated method stub
+//
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#isInfoEnabled(org.slf4j.Marker)
+// */
+// public boolean isInfoEnabled(Marker marker) {
+// // TODO Auto-generated method stub
+// return false;
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String)
+// */
+// public void info(Marker marker, String msg) {
+// // TODO Auto-generated method stub
+//
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String, java.lang.Object)
+// */
+// public void info(Marker marker, String format, Object arg) {
+// // TODO Auto-generated method stub
+//
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object)
+// */
+// public void info(Marker marker, String format, Object arg1, Object arg2) {
+// // TODO Auto-generated method stub
+//
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String, java.lang.Throwable)
+// */
+// public void info(Marker marker, String msg, Throwable t) {
+// // TODO Auto-generated method stub
+//
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#isWarnEnabled(org.slf4j.Marker)
+// */
+// public boolean isWarnEnabled(Marker marker) {
+// // TODO Auto-generated method stub
+// return false;
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String)
+// */
+// public void warn(Marker marker, String msg) {
+// // TODO Auto-generated method stub
+//
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String, java.lang.Object)
+// */
+// public void warn(Marker marker, String format, Object arg) {
+// // TODO Auto-generated method stub
+//
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object)
+// */
+// public void warn(Marker marker, String format, Object arg1, Object arg2) {
+// // TODO Auto-generated method stub
+//
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String, java.lang.Throwable)
+// */
+// public void warn(Marker marker, String msg, Throwable t) {
+// // TODO Auto-generated method stub
+//
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#isErrorEnabled(org.slf4j.Marker)
+// */
+// public boolean isErrorEnabled(Marker marker) {
+// // TODO Auto-generated method stub
+// return false;
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String)
+// */
+// public void error(Marker marker, String msg) {
+// // TODO Auto-generated method stub
+//
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String, java.lang.Object)
+// */
+// public void error(Marker marker, String format, Object arg) {
+// // TODO Auto-generated method stub
+//
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object)
+// */
+// public void error(Marker marker, String format, Object arg1, Object arg2) {
+// // TODO Auto-generated method stub
+//
+// }
+//
+//
+// /* (non-Javadoc)
+// * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String, java.lang.Throwable)
+// */
+// public void error(Marker marker, String msg, Throwable t) {
+// // TODO Auto-generated method stub
+//
+// }
+}
+
Modified: slf4j/trunk/tests/src/java/org/slf4j/impl/XLogger.java
==============================================================================
--- slf4j/trunk/tests/src/java/org/slf4j/impl/XLogger.java (original)
+++ slf4j/trunk/tests/src/java/org/slf4j/impl/XLogger.java Mon Nov 21 14:22:39 2005
@@ -33,7 +33,6 @@
package org.slf4j.impl;
import org.slf4j.Logger;
-import org.slf4j.Marker;
/**
@@ -115,193 +114,8 @@
public void error(String msg, Throwable t) {
}
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#getName()
- */
public String getName() {
- // TODO Auto-generated method stub
- return null;
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#isDebugEnabled(org.slf4j.Marker)
- */
- public boolean isDebugEnabled(Marker marker) {
- // TODO Auto-generated method stub
- return false;
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String)
- */
- public void debug(Marker marker, String msg) {
- // TODO Auto-generated method stub
-
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String, java.lang.Object)
- */
- public void debug(Marker marker, String format, Object arg) {
- // TODO Auto-generated method stub
-
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object)
- */
- public void debug(Marker marker, String format, Object arg1, Object arg2) {
- // TODO Auto-generated method stub
-
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#debug(org.slf4j.Marker, java.lang.String, java.lang.Throwable)
- */
- public void debug(Marker marker, String msg, Throwable t) {
- // TODO Auto-generated method stub
-
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#isInfoEnabled(org.slf4j.Marker)
- */
- public boolean isInfoEnabled(Marker marker) {
- // TODO Auto-generated method stub
- return false;
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String)
- */
- public void info(Marker marker, String msg) {
- // TODO Auto-generated method stub
-
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String, java.lang.Object)
- */
- public void info(Marker marker, String format, Object arg) {
- // TODO Auto-generated method stub
-
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object)
- */
- public void info(Marker marker, String format, Object arg1, Object arg2) {
- // TODO Auto-generated method stub
-
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#info(org.slf4j.Marker, java.lang.String, java.lang.Throwable)
- */
- public void info(Marker marker, String msg, Throwable t) {
- // TODO Auto-generated method stub
-
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#isWarnEnabled(org.slf4j.Marker)
- */
- public boolean isWarnEnabled(Marker marker) {
- // TODO Auto-generated method stub
- return false;
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String)
- */
- public void warn(Marker marker, String msg) {
- // TODO Auto-generated method stub
-
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String, java.lang.Object)
- */
- public void warn(Marker marker, String format, Object arg) {
- // TODO Auto-generated method stub
-
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object)
- */
- public void warn(Marker marker, String format, Object arg1, Object arg2) {
- // TODO Auto-generated method stub
-
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#warn(org.slf4j.Marker, java.lang.String, java.lang.Throwable)
- */
- public void warn(Marker marker, String msg, Throwable t) {
- // TODO Auto-generated method stub
-
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#isErrorEnabled(org.slf4j.Marker)
- */
- public boolean isErrorEnabled(Marker marker) {
- // TODO Auto-generated method stub
- return false;
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String)
- */
- public void error(Marker marker, String msg) {
- // TODO Auto-generated method stub
-
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String, java.lang.Object)
- */
- public void error(Marker marker, String format, Object arg) {
- // TODO Auto-generated method stub
-
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String, java.lang.Object, java.lang.Object)
- */
- public void error(Marker marker, String format, Object arg1, Object arg2) {
- // TODO Auto-generated method stub
-
- }
-
-
- /* (non-Javadoc)
- * @see org.slf4j.Logger#error(org.slf4j.Marker, java.lang.String, java.lang.Throwable)
- */
- public void error(Marker marker, String msg, Throwable t) {
- // TODO Auto-generated method stub
-
+ return "XLogger";
}
}
More information about the slf4j-dev
mailing list