diff --git a/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java b/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java index 3994188..bc8e73c 100644 --- a/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java +++ b/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java @@ -36,7 +36,7 @@ /** * The LoggerFactory is a utility class producing Loggers for * various logging APIs, most notably for log4j, logback and JDK 1.4 logging. - * Other implementations such as {@link org.slf4j.impl.NOPLogger NOPLogger} and + * Other implementations such as {@link org.slf4j.helpers.NOPLogger NOPLogger} and * {@link org.slf4j.impl.SimpleLogger SimpleLogger} are also supported. *

*

diff --git a/slf4j-api/src/main/java/org/slf4j/Marker.java b/slf4j-api/src/main/java/org/slf4j/Marker.java index 1349c40..69510ee 100644 --- a/slf4j-api/src/main/java/org/slf4j/Marker.java +++ b/slf4j-api/src/main/java/org/slf4j/Marker.java @@ -32,11 +32,11 @@ * system Implementations of SLF4J determine how information conveyed by markers * are used, if at all. In particular, many conforming logging systems ignore * marker data. - * + * *

- * Markers can contain references to other markers, which in turn may contain + * Markers can contain references to other markers, which in turn may contain * references of their own. - * + * * @author Ceki Gülcü */ public interface Marker extends Serializable { @@ -53,14 +53,14 @@ /** * Get the name of this Marker. - * + * * @return name of marker */ public String getName(); /** * Add a reference to another Marker. - * + * * @param reference * a reference to another marker * @throws IllegalArgumentException @@ -70,7 +70,7 @@ /** * Remove a marker reference. - * + * * @param reference * the marker reference to remove * @return true if reference could be found and removed, false otherwise. @@ -81,27 +81,27 @@ * @deprecated Replaced by {@link #hasReferences()}. */ public boolean hasChildren(); - + /** * Does this marker have any references? - * + * * @return true if this marker has one or more references, false otherwise. */ public boolean hasReferences(); - + /** * Returns an Iterator which can be used to iterate over the references of this * marker. An empty iterator is returned when this marker has no references. - * + * * @return Iterator over the references of this marker */ public Iterator iterator(); /** - * Does this marker contain a reference to the 'other' marker? Marker A is defined + * Does this marker contain a reference to the 'other' marker? Marker A is defined * to contain marker B, if A == B or if B is referenced by A, or if B is referenced * by any one of A's references (recursively). - * + * * @param other * The marker to test for inclusion. * @throws IllegalArgumentException @@ -112,11 +112,10 @@ /** * Does this marker contain the marker named 'name'? - * + * * If 'name' is null the returned value is always false. - * - * @param other - * The marker to test for inclusion. + * + * @param name The marker to test for inclusion. * @return Whether this marker contains the other marker. */ public boolean contains(String name); @@ -134,7 +133,7 @@ /** * Compute the hash code based on the name of this marker. * Note that markers are considered equal if they have the same name. - * + * * @return the computed hashCode * @since 1.5.1 */ diff --git a/slf4j-api/src/main/java/org/slf4j/helpers/MarkerIgnoringBase.java b/slf4j-api/src/main/java/org/slf4j/helpers/MarkerIgnoringBase.java index c128df5..87375c3 100644 --- a/slf4j-api/src/main/java/org/slf4j/helpers/MarkerIgnoringBase.java +++ b/slf4j-api/src/main/java/org/slf4j/helpers/MarkerIgnoringBase.java @@ -24,26 +24,25 @@ */ package org.slf4j.helpers; -import org.slf4j.Logger; import org.slf4j.Marker; /** - * This class serves as base for adapters or native implementations of logging systems - * lacking Marker support. In this implementation, methods taking marker data - * simply invoke the corresponding method without the Marker argument, discarding + * This class serves as base for adapters or native implementations of logging systems + * lacking Marker support. In this implementation, methods taking marker data + * simply invoke the corresponding method without the Marker argument, discarding * any marker data passed as argument. - * + * * @author Ceki Gulcu */ -public abstract class MarkerIgnoringBase extends NamedLoggerBase implements Logger { +public abstract class MarkerIgnoringBase extends NamedLoggerBase { private static final long serialVersionUID = 9044267456635152283L; public boolean isTraceEnabled(Marker marker) { return isTraceEnabled(); } - + public void trace(Marker marker, String msg) { trace(msg); } @@ -63,7 +62,7 @@ public void trace(Marker marker, String msg, Throwable t) { trace(msg, t); } - + public boolean isDebugEnabled(Marker marker) { return isDebugEnabled(); } @@ -136,7 +135,7 @@ warn(msg, t); } - + public boolean isErrorEnabled(Marker marker) { return isErrorEnabled(); } @@ -164,5 +163,5 @@ public String toString() { return this.getClass().getName()+"("+getName()+")"; } - + } diff --git a/slf4j-api/src/main/java/org/slf4j/helpers/MessageFormatter.java b/slf4j-api/src/main/java/org/slf4j/helpers/MessageFormatter.java index fc794e2..d98f094 100644 --- a/slf4j-api/src/main/java/org/slf4j/helpers/MessageFormatter.java +++ b/slf4j-api/src/main/java/org/slf4j/helpers/MessageFormatter.java @@ -33,14 +33,14 @@ /** * Formats messages according to very simple substitution rules. Substitutions * can be made 1, 2 or more arguments. - * + * *

* For example, - * + * *

  * MessageFormatter.format("Hi {}.", "there")
  * 
- * + * * will return the string "Hi there.". *

* The {} pair is called the formatting anchor. It serves to designate @@ -50,48 +50,48 @@ * In case your message contains the '{' or the '}' character, you do not have * to do anything special unless the '}' character immediately follows '{'. For * example, - * + * *

  * MessageFormatter.format("Set {1,2,3} is not equal to {}.", "1,2");
  * 
- * + * * will return the string "Set {1,2,3} is not equal to 1,2.". - * + * *

* If for whatever reason you need to place the string "{}" in the message * without its formatting anchor meaning, then you need to escape the * '{' character with '\', that is the backslash character. Only the '{' * character should be escaped. There is no need to escape the '}' character. * For example, - * + * *

  * MessageFormatter.format("Set \\{} is not equal to {}.", "1,2");
  * 
- * + * * will return the string "Set {} is not equal to 1,2.". - * + * *

* The escaping behavior just described can be overridden by escaping the escape * character '\'. Calling - * + * *

  * MessageFormatter.format("File name is C:\\\\{}.", "file.zip");
  * 
- * + * * will return the string "File name is C:\file.zip". - * + * *

* The formatting conventions are different than those of {@link MessageFormat} * which ships with the Java platform. This is justified by the fact that * SLF4J's implementation is 10 times faster than that of {@link MessageFormat}. * This local performance difference is both measurable and significant in the * larger context of the complete logging processing chain. - * + * *

* See also {@link #format(String, Object)}, * {@link #format(String, Object, Object)} and * {@link #arrayFormat(String, Object[])} methods for more details. - * + * * @author Ceki Gülcü * @author Joern Huxhorn */ @@ -106,17 +106,17 @@ * parameter. *

* For example, - * + * *

    * MessageFormatter.format("Hi {}.", "there");
    * 
- * + * * will return the string "Hi there.". *

- * + * * @param messagePattern * The message pattern which will be parsed and formatted - * @param argument + * @param arg * The argument to be substituted in place of the formatting anchor * @return The formatted message */ @@ -125,18 +125,18 @@ } /** - * + * * Performs a two argument substitution for the 'messagePattern' passed as * parameter. *

* For example, - * + * *

    * MessageFormatter.format("Hi {}. My name is {}.", "Alice", "Bob");
    * 
- * + * * will return the string "Hi Alice. My name is Bob.". - * + * * @param messagePattern * The message pattern which will be parsed and formatted * @param arg1 @@ -168,7 +168,7 @@ * Same principle as the {@link #format(String, Object)} and * {@link #format(String, Object, Object)} methods except that any number of * arguments can be passed in an array. - * + * * @param messagePattern * The message pattern which will be parsed and formatted * @param argArray diff --git a/slf4j-api/src/main/java/org/slf4j/helpers/NOPLogger.java b/slf4j-api/src/main/java/org/slf4j/helpers/NOPLogger.java index b36be30..b063a40 100644 --- a/slf4j-api/src/main/java/org/slf4j/helpers/NOPLogger.java +++ b/slf4j-api/src/main/java/org/slf4j/helpers/NOPLogger.java @@ -43,7 +43,7 @@ public static final NOPLogger NOP_LOGGER = new NOPLogger(); /** - * There is no point in creating multiple instances of NOPLOgger, + * There is no point in creating multiple instances of NOPLOgger, * except by derived classes, hence the protected access for the constructor. */ protected NOPLogger() { @@ -80,10 +80,10 @@ } /** A NOP implementation. */ - public final void trace(String format, Object[] argArray) { + public final void trace(String format, Object... argArray) { // NOP } - + /** A NOP implementation. */ final public void trace(String msg, Throwable t) { // NOP @@ -113,12 +113,10 @@ } /** A NOP implementation. */ - public final void debug(String format, Object[] argArray) { + public final void debug(String format, Object... argArray) { // NOP } - - - + /** A NOP implementation. */ final public void debug(String msg, Throwable t) { // NOP @@ -148,18 +146,16 @@ final public void info(String format, Object arg1, Object arg2) { // NOP } - + /** A NOP implementation. */ - public final void info(String format, Object[] argArray) { + public final void info(String format, Object... argArray) { // NOP } - /** A NOP implementation. */ final public void info(String msg, Throwable t) { // NOP } - /** * Always returns false. @@ -183,18 +179,16 @@ final public void warn(String format, Object arg1, Object arg2) { // NOP } - + /** A NOP implementation. */ - public final void warn(String format, Object[] argArray) { + public final void warn(String format, Object... argArray) { // NOP } - /** A NOP implementation. */ final public void warn(String msg, Throwable t) { // NOP } - /** A NOP implementation. */ final public boolean isErrorEnabled() { @@ -215,12 +209,11 @@ final public void error(String format, Object arg1, Object arg2) { // NOP } - + /** A NOP implementation. */ - public final void error(String format, Object[] argArray) { + public final void error(String format, Object... argArray) { // NOP } - /** A NOP implementation. */ final public void error(String msg, Throwable t) { diff --git a/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java index 7148e80..2a58325 100644 --- a/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java +++ b/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java @@ -27,38 +27,38 @@ import org.slf4j.ILoggerFactory; /** - * The binding of {@link LoggerFactory} class with an actual instance of + * The binding of {@link org.slf4j.LoggerFactory} class with an actual instance of * {@link ILoggerFactory} is performed using information returned by this class. - * - * This class is meant to provide a dummy StaticLoggerBinder to the slf4j-api module. - * Real implementations are found in each SLF4J binding project, e.g. slf4j-nop, + * + * This class is meant to provide a dummy StaticLoggerBinder to the slf4j-api module. + * Real implementations are found in each SLF4J binding project, e.g. slf4j-nop, * slf4j-log4j12 etc. - * + * * @author Ceki Gülcü */ public class StaticLoggerBinder { - + /** * The unique instance of this class. */ private static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder(); - + /** * Return the singleton of this class. - * + * * @return the StaticLoggerBinder singleton */ public static final StaticLoggerBinder getSingleton() { return SINGLETON; } - + /** - * Declare the version of the SLF4J API this implementation is compiled against. - * The value of this field is usually modified with each release. + * Declare the version of the SLF4J API this implementation is compiled against. + * The value of this field is usually modified with each release. */ // to avoid constant folding by the compiler, this field must *not* be final public static String REQUESTED_API_VERSION = "1.6.99"; // !final - + private StaticLoggerBinder() { throw new UnsupportedOperationException("This code should have never made it into slf4j-api.jar"); }