mirror of https://github.com/qos-ch/slf4j
improved javadocs
This commit is contained in:
parent
7747f1ec4f
commit
3b040e36ff
|
|
@ -102,6 +102,8 @@ public interface Log {
|
|||
* <p> Call this method to prevent having to perform expensive operations
|
||||
* (for example, <code>String</code> concatenation)
|
||||
* when the log level is more than info. </p>
|
||||
*
|
||||
* @return true if info enabled, false otherwise
|
||||
*/
|
||||
public boolean isInfoEnabled();
|
||||
|
||||
|
|
@ -112,6 +114,8 @@ public interface Log {
|
|||
* <p> Call this method to prevent having to perform expensive operations
|
||||
* (for example, <code>String</code> concatenation)
|
||||
* when the log level is more than trace. </p>
|
||||
*
|
||||
* @return true if trace enabled, false otherwise
|
||||
*/
|
||||
public boolean isTraceEnabled();
|
||||
|
||||
|
|
|
|||
|
|
@ -140,8 +140,8 @@ public abstract class LogFactory {
|
|||
* Return the configuration attribute with the specified name (if any), or
|
||||
* <code>null</code> if there is no such attribute.
|
||||
*
|
||||
* @param name
|
||||
* Name of the attribute to return
|
||||
* @param name Name of the attribute to return
|
||||
* @return configuration attribute
|
||||
*/
|
||||
public abstract Object getAttribute(String name);
|
||||
|
||||
|
|
@ -149,6 +149,8 @@ public abstract class LogFactory {
|
|||
* Return an array containing the names of all currently defined configuration
|
||||
* attributes. If there are no such attributes, a zero length array is
|
||||
* returned.
|
||||
*
|
||||
* @return names of all currently defined configuration attributes
|
||||
*/
|
||||
public abstract String[] getAttributeNames();
|
||||
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ public class SLF4JBridgeHandler extends Handler {
|
|||
/**
|
||||
* Returns true if SLF4JBridgeHandler has been previously installed, returns false otherwise.
|
||||
*
|
||||
* @return
|
||||
* @return true if SLF4JBridgeHandler is already installed, false other wise
|
||||
* @throws SecurityException
|
||||
*/
|
||||
public static boolean isInstalled() throws SecurityException {
|
||||
|
|
|
|||
67
pom.xml
67
pom.xml
|
|
@ -216,14 +216,14 @@
|
|||
<linkJavadoc>true</linkJavadoc>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.8</version>
|
||||
<configuration>
|
||||
<aggregate>true</aggregate>
|
||||
<excludePackageNames>org.slf4j.migrator:org.slf4j.migrator.*
|
||||
</excludePackageNames>
|
||||
<!--<aggregate>true</aggregate>-->
|
||||
<excludePackageNames>org.slf4j.migrator:org.slf4j.migrator.*</excludePackageNames>
|
||||
<links>
|
||||
<link>
|
||||
http://java.sun.com/j2se/1.5.0/docs/api
|
||||
|
|
@ -238,7 +238,7 @@
|
|||
<group>
|
||||
<title>SLF4J extensions</title>
|
||||
<packages>
|
||||
org.slf4j.profiler:org.slf4j.ext:org.slf4j.instrumentation:org.slf4j.agent
|
||||
org.slf4j.cal10n:org.slf4j.profiler:org.slf4j.ext:org.slf4j.instrumentation:org.slf4j.agent
|
||||
</packages>
|
||||
</group>
|
||||
|
||||
|
|
@ -247,16 +247,18 @@
|
|||
<packages>org.apache.commons.*</packages>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<title>Apache log4j</title>
|
||||
<packages>org.apache.log4j</packages>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<title>java.util.logging (JUL) to SLF4J bridge</title>
|
||||
<packages>org.slf4j.bridge</packages>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<title>Apache log4j</title>
|
||||
<packages>org.apache.log4j:org.apache.log4j.*</packages>
|
||||
</group>
|
||||
|
||||
|
||||
|
||||
</groups>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
|
@ -275,53 +277,6 @@
|
|||
<maven.test.skip>true</maven.test.skip>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>osgi</id>
|
||||
<modules>
|
||||
<module>osgi-over-slf4j</module>
|
||||
<module>slf4j-osgi-test-bundle</module>
|
||||
<module>slf4j-osgi-integration-test</module>
|
||||
</modules>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>m2apache.snapshots</id>
|
||||
<url>http://people.apache.org/repo/m2-snapshot-repository</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
<id>springframework.org</id>
|
||||
<name>Springframework Maven SNAPSHOT Repository</name>
|
||||
<url>http://static.springframework.org/maven2-snapshots/</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>apache.snapshots</id>
|
||||
<name>Apache Snapshot Plugin Repository</name>
|
||||
<url>http://people.apache.org/repo/m2-snapshot-repository</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</profile>
|
||||
|
||||
|
||||
<profile>
|
||||
<id>javadocjar</id>
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ public interface ILoggerFactory {
|
|||
* return the same logger instance regardless of the requested name.
|
||||
*
|
||||
* @param name the name of the Logger to return
|
||||
* @return a Logger instance
|
||||
*/
|
||||
public Logger getLogger(String name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,8 @@ public interface IMarkerFactory {
|
|||
/**
|
||||
* Checks if the marker with the name already exists. If name is null, then false
|
||||
* is returned.
|
||||
*
|
||||
*
|
||||
* @param name logger name to check for
|
||||
* @return true id the marker exists, false otherwise.
|
||||
*/
|
||||
boolean exists(String name);
|
||||
|
|
@ -73,7 +74,8 @@ public interface IMarkerFactory {
|
|||
|
||||
/**
|
||||
* Create a marker which is detached (even at birth) from this IMarkerFactory.
|
||||
*
|
||||
*
|
||||
* @param name marker name
|
||||
* @return a dangling marker
|
||||
* @since 1.5.1
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -52,6 +52,13 @@ package org.slf4j;
|
|||
* }
|
||||
* </pre>
|
||||
*
|
||||
* Be sure to read the FAQ entry relating to <a href="../../../faq.html#logging_performance">parameterized
|
||||
* logging</a>. Note that logging statements can be parameterized in
|
||||
* <a href="../../../faq.html#paramException">presence of an exception/throwable</a>.
|
||||
*
|
||||
* <p>Once you are comfortable using loggers, i.e. instances of this interface, consider using
|
||||
* <a href="MDC.html">MDC</a> as well as <a href="Marker.html">Markers</a>.</p>
|
||||
*
|
||||
* @author Ceki Gülcü
|
||||
*/
|
||||
public interface Logger {
|
||||
|
|
@ -66,6 +73,7 @@ public interface Logger {
|
|||
|
||||
/**
|
||||
* Return the name of this <code>Logger</code> instance.
|
||||
* @return name of this logger instance
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
|
|
@ -148,6 +156,9 @@ public interface Logger {
|
|||
* marker data is also taken into account.
|
||||
*
|
||||
* @param marker The marker data to take into consideration
|
||||
* @return True if this Logger is enabled for the TRACE level,
|
||||
* false otherwise.
|
||||
*
|
||||
* @since 1.4
|
||||
*/
|
||||
public boolean isTraceEnabled(Marker marker);
|
||||
|
|
@ -285,6 +296,8 @@ public interface Logger {
|
|||
* marker data is also taken into account.
|
||||
*
|
||||
* @param marker The marker data to take into consideration
|
||||
* @return True if this Logger is enabled for the DEBUG level,
|
||||
* false otherwise.
|
||||
*/
|
||||
public boolean isDebugEnabled(Marker marker);
|
||||
|
||||
|
|
@ -415,6 +428,7 @@ public interface Logger {
|
|||
* data is also taken into consideration.
|
||||
*
|
||||
* @param marker The marker data to take into consideration
|
||||
* @return true if this logger is warn enabled, false otherwise
|
||||
*/
|
||||
public boolean isInfoEnabled(Marker marker);
|
||||
|
||||
|
|
@ -544,6 +558,8 @@ public interface Logger {
|
|||
* data is also taken into consideration.
|
||||
*
|
||||
* @param marker The marker data to take into consideration
|
||||
* @return True if this Logger is enabled for the WARN level,
|
||||
* false otherwise.
|
||||
*/
|
||||
public boolean isWarnEnabled(Marker marker);
|
||||
|
||||
|
|
@ -671,6 +687,8 @@ public interface Logger {
|
|||
* marker data is also taken into consideration.
|
||||
*
|
||||
* @param marker The marker data to take into consideration
|
||||
* @return True if this Logger is enabled for the ERROR level,
|
||||
* false otherwise.
|
||||
*/
|
||||
public boolean isErrorEnabled(Marker marker);
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ import org.slf4j.spi.MDCAdapter;
|
|||
* and slf4j-nop, {@link NOPMDCAdapter} will be used.
|
||||
*
|
||||
* <p>
|
||||
* Thus, as a SLF4J user, you can take advantage of MDC in the presence of log4j
|
||||
* Thus, as a SLF4J user, you can take advantage of MDC in the presence of log4j,
|
||||
* logback, or java.util.logging, but without forcing these systems as
|
||||
* dependencies upon your users.
|
||||
*
|
||||
|
|
@ -90,13 +90,16 @@ public class MDC {
|
|||
}
|
||||
|
||||
/**
|
||||
* Put a context value (the <code>val</code> parameter) as identified with the
|
||||
* <code>key</code> parameter into the current thread's context map. The
|
||||
* Put a diagnostic context value (the <code>val</code> parameter) as identified with the
|
||||
* <code>key</code> parameter into the current thread's diagnostic context map. The
|
||||
* <code>key</code> parameter cannot be null. The <code>val</code> parameter
|
||||
* can be null only if the underlying implementation supports it.
|
||||
*
|
||||
* <p>
|
||||
* This method delegates all work to the MDC of the underlying logging system.
|
||||
*
|
||||
* @param key non-null key
|
||||
* @param val value to put in the map
|
||||
*
|
||||
* @throws IllegalArgumentException
|
||||
* in case the "key" parameter is null
|
||||
|
|
@ -114,12 +117,13 @@ public class MDC {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the context identified by the <code>key</code> parameter. The
|
||||
* Get the diagnostic context identified by the <code>key</code> parameter. The
|
||||
* <code>key</code> parameter cannot be null.
|
||||
*
|
||||
* <p>
|
||||
* This method delegates all work to the MDC of the underlying logging system.
|
||||
*
|
||||
*
|
||||
* @param key
|
||||
* @return the string value identified by the <code>key</code> parameter.
|
||||
* @throws IllegalArgumentException
|
||||
* in case the "key" parameter is null
|
||||
|
|
@ -137,11 +141,12 @@ public class MDC {
|
|||
}
|
||||
|
||||
/**
|
||||
* Remove the the context identified by the <code>key</code> parameter using
|
||||
* Remove the diagnostic context identified by the <code>key</code> parameter using
|
||||
* the underlying system's MDC implementation. The <code>key</code> parameter
|
||||
* cannot be null. This method does nothing if there is no previous value
|
||||
* associated with <code>key</code>.
|
||||
*
|
||||
*
|
||||
* @param key
|
||||
* @throws IllegalArgumentException
|
||||
* in case the "key" parameter is null
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -115,8 +115,7 @@ public interface Marker extends Serializable {
|
|||
*
|
||||
* If 'name' is null the returned value is always false.
|
||||
*
|
||||
* @param other
|
||||
* The marker to test for inclusion.
|
||||
* @param name The marker name to test for inclusion.
|
||||
* @return Whether this marker contains the other marker.
|
||||
*/
|
||||
public boolean contains(String name);
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ public class MarkerFactory {
|
|||
/**
|
||||
* Create a marker which is detached (even at birth) from the MarkerFactory.
|
||||
*
|
||||
* @param name the name of the marker
|
||||
* @return a dangling marker
|
||||
* @since 1.5.1
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ public class NOPLogger extends MarkerIgnoringBase {
|
|||
}
|
||||
|
||||
/** A NOP implementation. */
|
||||
public final void trace(String format, Object[] argArray) {
|
||||
public final void trace(String format, Object... argArray) {
|
||||
// NOP
|
||||
}
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ public class NOPLogger extends MarkerIgnoringBase {
|
|||
}
|
||||
|
||||
/** A NOP implementation. */
|
||||
public final void debug(String format, Object[] argArray) {
|
||||
public final void debug(String format, Object... argArray) {
|
||||
// NOP
|
||||
}
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ public class NOPLogger extends MarkerIgnoringBase {
|
|||
}
|
||||
|
||||
/** A NOP implementation. */
|
||||
public final void info(String format, Object[] argArray) {
|
||||
public final void info(String format, Object... argArray) {
|
||||
// NOP
|
||||
}
|
||||
|
||||
|
|
@ -185,7 +185,7 @@ public class NOPLogger extends MarkerIgnoringBase {
|
|||
}
|
||||
|
||||
/** A NOP implementation. */
|
||||
public final void warn(String format, Object[] argArray) {
|
||||
public final void warn(String format, Object... argArray) {
|
||||
// NOP
|
||||
}
|
||||
|
||||
|
|
@ -217,7 +217,7 @@ public class NOPLogger extends MarkerIgnoringBase {
|
|||
}
|
||||
|
||||
/** A NOP implementation. */
|
||||
public final void error(String format, Object[] argArray) {
|
||||
public final void error(String format, Object... argArray) {
|
||||
// NOP
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class LocLoggerFactory {
|
|||
* Get an LocLogger instance by name.
|
||||
*
|
||||
* @param name
|
||||
* @return
|
||||
* @return LocLogger instance by name.
|
||||
*/
|
||||
public LocLogger getLocLogger(String name) {
|
||||
return new LocLogger(LoggerFactory.getLogger(name), imc);
|
||||
|
|
@ -67,9 +67,8 @@ public class LocLoggerFactory {
|
|||
* after the class.
|
||||
*
|
||||
* @param clazz
|
||||
* @return
|
||||
* @return LocLogger instance by class
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public LocLogger getLocLogger(Class clazz) {
|
||||
return getLocLogger(clazz.getName());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<p>SLF4J API extensions</p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -97,6 +97,7 @@ public class EventData implements Serializable {
|
|||
/**
|
||||
* Serialize all the EventData items into an XML representation.
|
||||
*
|
||||
* @param map the Map to transform
|
||||
* @return an XML String containing all the EventDAta items.
|
||||
*/
|
||||
public static String toXML(Map<String, Object> map) {
|
||||
|
|
|
|||
|
|
@ -130,17 +130,17 @@ public class LoggerWrapper implements Logger {
|
|||
/**
|
||||
* Delegate to the appropriate method of the underlying logger.
|
||||
*/
|
||||
public void trace(String format, Object[] argArray) {
|
||||
public void trace(String format, Object... args) {
|
||||
if (!logger.isTraceEnabled())
|
||||
return;
|
||||
|
||||
if (instanceofLAL) {
|
||||
String formattedMessage = MessageFormatter.arrayFormat(format, argArray)
|
||||
String formattedMessage = MessageFormatter.arrayFormat(format, args)
|
||||
.getMessage();
|
||||
((LocationAwareLogger) logger).log(null, fqcn,
|
||||
LocationAwareLogger.TRACE_INT, formattedMessage, argArray, null);
|
||||
LocationAwareLogger.TRACE_INT, formattedMessage, args, null);
|
||||
} else {
|
||||
logger.trace(format, argArray);
|
||||
logger.trace(format, args);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -210,16 +210,16 @@ public class LoggerWrapper implements Logger {
|
|||
/**
|
||||
* Delegate to the appropriate method of the underlying logger.
|
||||
*/
|
||||
public void trace(Marker marker, String format, Object[] argArray) {
|
||||
public void trace(Marker marker, String format, Object... args) {
|
||||
if (!logger.isTraceEnabled(marker))
|
||||
return;
|
||||
if (instanceofLAL) {
|
||||
String formattedMessage = MessageFormatter.arrayFormat(format, argArray)
|
||||
String formattedMessage = MessageFormatter.arrayFormat(format, args)
|
||||
.getMessage();
|
||||
((LocationAwareLogger) logger).log(marker, fqcn,
|
||||
LocationAwareLogger.TRACE_INT, formattedMessage, argArray, null);
|
||||
LocationAwareLogger.TRACE_INT, formattedMessage, args, null);
|
||||
} else {
|
||||
logger.trace(marker, format, argArray);
|
||||
logger.trace(marker, format, args);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -305,7 +305,7 @@ public class LoggerWrapper implements Logger {
|
|||
/**
|
||||
* Delegate to the appropriate method of the underlying logger.
|
||||
*/
|
||||
public void debug(String format, Object[] argArray) {
|
||||
public void debug(String format, Object... argArray) {
|
||||
if (!logger.isDebugEnabled())
|
||||
return;
|
||||
|
||||
|
|
@ -384,7 +384,7 @@ public class LoggerWrapper implements Logger {
|
|||
/**
|
||||
* Delegate to the appropriate method of the underlying logger.
|
||||
*/
|
||||
public void debug(Marker marker, String format, Object[] argArray) {
|
||||
public void debug(Marker marker, String format, Object... argArray) {
|
||||
if (!logger.isDebugEnabled(marker))
|
||||
return;
|
||||
if (instanceofLAL) {
|
||||
|
|
@ -480,17 +480,17 @@ public class LoggerWrapper implements Logger {
|
|||
/**
|
||||
* Delegate to the appropriate method of the underlying logger.
|
||||
*/
|
||||
public void info(String format, Object[] argArray) {
|
||||
public void info(String format, Object... args) {
|
||||
if (!logger.isInfoEnabled())
|
||||
return;
|
||||
|
||||
if (instanceofLAL) {
|
||||
String formattedMessage = MessageFormatter.arrayFormat(format, argArray)
|
||||
String formattedMessage = MessageFormatter.arrayFormat(format, args)
|
||||
.getMessage();
|
||||
((LocationAwareLogger) logger).log(null, fqcn,
|
||||
LocationAwareLogger.INFO_INT, formattedMessage, argArray, null);
|
||||
LocationAwareLogger.INFO_INT, formattedMessage, args, null);
|
||||
} else {
|
||||
logger.info(format, argArray);
|
||||
logger.info(format, args);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -560,16 +560,16 @@ public class LoggerWrapper implements Logger {
|
|||
/**
|
||||
* Delegate to the appropriate method of the underlying logger.
|
||||
*/
|
||||
public void info(Marker marker, String format, Object[] argArray) {
|
||||
public void info(Marker marker, String format, Object... args) {
|
||||
if (!logger.isInfoEnabled(marker))
|
||||
return;
|
||||
if (instanceofLAL) {
|
||||
String formattedMessage = MessageFormatter.arrayFormat(format, argArray)
|
||||
String formattedMessage = MessageFormatter.arrayFormat(format, args)
|
||||
.getMessage();
|
||||
((LocationAwareLogger) logger).log(marker, fqcn,
|
||||
LocationAwareLogger.INFO_INT, formattedMessage, argArray, null);
|
||||
LocationAwareLogger.INFO_INT, formattedMessage, args, null);
|
||||
} else {
|
||||
logger.info(marker, format, argArray);
|
||||
logger.info(marker, format, args);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -652,17 +652,17 @@ public class LoggerWrapper implements Logger {
|
|||
/**
|
||||
* Delegate to the appropriate method of the underlying logger.
|
||||
*/
|
||||
public void warn(String format, Object[] argArray) {
|
||||
public void warn(String format, Object... args) {
|
||||
if (!logger.isWarnEnabled())
|
||||
return;
|
||||
|
||||
if (instanceofLAL) {
|
||||
String formattedMessage = MessageFormatter.arrayFormat(format, argArray)
|
||||
String formattedMessage = MessageFormatter.arrayFormat(format, args)
|
||||
.getMessage();
|
||||
((LocationAwareLogger) logger).log(null, fqcn,
|
||||
LocationAwareLogger.WARN_INT, formattedMessage, argArray, null);
|
||||
LocationAwareLogger.WARN_INT, formattedMessage, args, null);
|
||||
} else {
|
||||
logger.warn(format, argArray);
|
||||
logger.warn(format, args);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -732,16 +732,16 @@ public class LoggerWrapper implements Logger {
|
|||
/**
|
||||
* Delegate to the appropriate method of the underlying logger.
|
||||
*/
|
||||
public void warn(Marker marker, String format, Object[] argArray) {
|
||||
public void warn(Marker marker, String format, Object... args) {
|
||||
if (!logger.isWarnEnabled(marker))
|
||||
return;
|
||||
if (instanceofLAL) {
|
||||
String formattedMessage = MessageFormatter.arrayFormat(format, argArray)
|
||||
String formattedMessage = MessageFormatter.arrayFormat(format, args)
|
||||
.getMessage();
|
||||
((LocationAwareLogger) logger).log(marker, fqcn,
|
||||
LocationAwareLogger.WARN_INT, formattedMessage, argArray, null);
|
||||
LocationAwareLogger.WARN_INT, formattedMessage, args, null);
|
||||
} else {
|
||||
logger.warn(marker, format, argArray);
|
||||
logger.warn(marker, format, args);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -827,17 +827,17 @@ public class LoggerWrapper implements Logger {
|
|||
/**
|
||||
* Delegate to the appropriate method of the underlying logger.
|
||||
*/
|
||||
public void error(String format, Object[] argArray) {
|
||||
public void error(String format, Object... args) {
|
||||
if (!logger.isErrorEnabled())
|
||||
return;
|
||||
|
||||
if (instanceofLAL) {
|
||||
String formattedMessage = MessageFormatter.arrayFormat(format, argArray)
|
||||
String formattedMessage = MessageFormatter.arrayFormat(format, args)
|
||||
.getMessage();
|
||||
((LocationAwareLogger) logger).log(null, fqcn,
|
||||
LocationAwareLogger.ERROR_INT, formattedMessage, argArray, null);
|
||||
LocationAwareLogger.ERROR_INT, formattedMessage, args, null);
|
||||
} else {
|
||||
logger.error(format, argArray);
|
||||
logger.error(format, args);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -907,16 +907,16 @@ public class LoggerWrapper implements Logger {
|
|||
/**
|
||||
* Delegate to the appropriate method of the underlying logger.
|
||||
*/
|
||||
public void error(Marker marker, String format, Object[] argArray) {
|
||||
public void error(Marker marker, String format, Object... args) {
|
||||
if (!logger.isErrorEnabled(marker))
|
||||
return;
|
||||
if (instanceofLAL) {
|
||||
String formattedMessage = MessageFormatter.arrayFormat(format, argArray)
|
||||
String formattedMessage = MessageFormatter.arrayFormat(format, args)
|
||||
.getMessage();
|
||||
((LocationAwareLogger) logger).log(marker, fqcn,
|
||||
LocationAwareLogger.ERROR_INT, formattedMessage, argArray, null);
|
||||
LocationAwareLogger.ERROR_INT, formattedMessage, args, null);
|
||||
} else {
|
||||
logger.error(marker, format, argArray);
|
||||
logger.error(marker, format, args);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@ import org.slf4j.LoggerFactory;
|
|||
* {@link LoggerFactory} producing {@link XLogger} instances.
|
||||
*
|
||||
* <p>Contrary to {@link LoggerFactory#getLogger(String)} method of
|
||||
* {@link LoggerFactory}, each call to {@link getXLogger}
|
||||
* produces a new instance of XLogger. This should not matter because an
|
||||
* XLogger instance does not have any state beyond that of the Logger instance
|
||||
* it wraps.
|
||||
* {@link LoggerFactory}, each call to {@link #getXLogger(String)}
|
||||
* produces a new instance of <code>XLogger</code>. This should not matter
|
||||
* because an <code>XLogger</code> instance does not have any state beyond that of
|
||||
* the {@link org.slf4j.Logger Logger} instance it wraps.
|
||||
*
|
||||
* @author Ralph Goers
|
||||
* @author Ceki Gülcü
|
||||
|
|
@ -46,7 +46,7 @@ public class XLoggerFactory {
|
|||
* Get an XLogger instance by name.
|
||||
*
|
||||
* @param name
|
||||
* @return
|
||||
* @return XLogger instance
|
||||
*/
|
||||
public static XLogger getXLogger(String name) {
|
||||
return new XLogger(LoggerFactory.getLogger(name));
|
||||
|
|
@ -57,9 +57,8 @@ public class XLoggerFactory {
|
|||
* will be named after the class.
|
||||
*
|
||||
* @param clazz
|
||||
* @return
|
||||
* @return XLogger instance by name
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static XLogger getXLogger(Class clazz) {
|
||||
return getXLogger(clazz.getName());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@
|
|||
|
||||
|
||||
<body>
|
||||
<p>SLF4J API extensions</p>
|
||||
<p>Localized logging using the <a href="http://cal10n.qos.ch">CAL10N</a> API.</p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -60,6 +60,9 @@ public class SpacePadder {
|
|||
|
||||
/**
|
||||
* Fast space padding method.
|
||||
*
|
||||
* @param sbuf the buffer to pad
|
||||
* @param length the target size of the buffer after padding
|
||||
*/
|
||||
final static public void spacePad(StringBuffer sbuf, int length) {
|
||||
while (length >= 32) {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,9 @@ public class StaticMDCBinder {
|
|||
|
||||
/**
|
||||
* Currently this method always returns an instance of
|
||||
* {@link StaticMDCBinder}.
|
||||
* {@link NOPMDCAdapter}.
|
||||
*
|
||||
* @return instance of NOPMDCAdapter
|
||||
*/
|
||||
public MDCAdapter getMDCA() {
|
||||
return new NOPMDCAdapter();
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ public class InvocationTest extends TestCase {
|
|||
}
|
||||
|
||||
public void testMDCContextMapValues() {
|
||||
Map map = new HashMap();
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
map.put("ka", "va");
|
||||
map.put("kb", "vb");
|
||||
|
||||
|
|
|
|||
|
|
@ -57,9 +57,9 @@ public class ProjectConverter {
|
|||
* Ask for concrete matcher implementation depending on the conversion mode
|
||||
* Ask for user confirmation to convert the selected source directory if valid
|
||||
* Ask for user confirmation in case of number of files to convert > 1000
|
||||
*
|
||||
* @return true if init operation complete
|
||||
* @throws IOException
|
||||
*
|
||||
* @param conversionType
|
||||
* @param progressListener
|
||||
*/
|
||||
public ProjectConverter(int conversionType, ProgressListener progressListener) {
|
||||
this.progressListener = progressListener;
|
||||
|
|
|
|||
|
|
@ -466,7 +466,7 @@ public class SimpleLogger extends MarkerIgnoringBase {
|
|||
* Perform double parameter substitution before logging the message of level
|
||||
* TRACE according to the format outlined above.
|
||||
*/
|
||||
public void trace(String format, Object[] argArray) {
|
||||
public void trace(String format, Object... argArray) {
|
||||
formatAndLog(LOG_LEVEL_TRACE, format, argArray);
|
||||
}
|
||||
|
||||
|
|
@ -508,7 +508,7 @@ public class SimpleLogger extends MarkerIgnoringBase {
|
|||
* Perform double parameter substitution before logging the message of level
|
||||
* DEBUG according to the format outlined above.
|
||||
*/
|
||||
public void debug(String format, Object[] argArray) {
|
||||
public void debug(String format, Object... argArray) {
|
||||
formatAndLog(LOG_LEVEL_DEBUG, format, argArray);
|
||||
}
|
||||
|
||||
|
|
@ -550,7 +550,7 @@ public class SimpleLogger extends MarkerIgnoringBase {
|
|||
* Perform double parameter substitution before logging the message of level
|
||||
* INFO according to the format outlined above.
|
||||
*/
|
||||
public void info(String format, Object[] argArray) {
|
||||
public void info(String format, Object... argArray) {
|
||||
formatAndLog(LOG_LEVEL_INFO, format, argArray);
|
||||
}
|
||||
|
||||
|
|
@ -592,7 +592,7 @@ public class SimpleLogger extends MarkerIgnoringBase {
|
|||
* Perform double parameter substitution before logging the message of level
|
||||
* WARN according to the format outlined above.
|
||||
*/
|
||||
public void warn(String format, Object[] argArray) {
|
||||
public void warn(String format, Object... argArray) {
|
||||
formatAndLog(LOG_LEVEL_WARN, format, argArray);
|
||||
}
|
||||
|
||||
|
|
@ -634,7 +634,7 @@ public class SimpleLogger extends MarkerIgnoringBase {
|
|||
* Perform double parameter substitution before logging the message of level
|
||||
* ERROR according to the format outlined above.
|
||||
*/
|
||||
public void error(String format, Object[] argArray) {
|
||||
public void error(String format, Object... argArray) {
|
||||
formatAndLog(LOG_LEVEL_ERROR, format, argArray);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -281,7 +281,13 @@ SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further detail
|
|||
addition to <em>logback-classic-${logback.version}.jar</em>,
|
||||
this will pull <em>slf4j-api-${project.version}.jar</em> as well
|
||||
as <em>logback-core-${logback.version}.jar</em> into your
|
||||
project.</p>
|
||||
project. Note that explicitly declaring a dependency on
|
||||
<em>logback-core-${logback.version}</em> or
|
||||
<em>slf4j-api-${project.version}.jar</em> is not wrong and may
|
||||
be necessary to impose the correct version of said artifacts by
|
||||
virtue of Maven's "nearest definition" dependency mediation
|
||||
rule.
|
||||
</p>
|
||||
|
||||
<pre class="prettyprint source"><dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
|
|
@ -297,7 +303,13 @@ SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further detail
|
|||
<em>pom.xml</em> file as shown below. In addition to
|
||||
<em>slf4j-log4j12-${project.version}.jar</em>, this will pull
|
||||
<em>slf4j-api-${project.version}.jar</em> as well as
|
||||
<em>log4j-${log4j.version}.jar</em> into your project.</p>
|
||||
<em>log4j-${log4j.version}.jar</em> into your project. Note
|
||||
that explicitly declaring a dependency on
|
||||
<em>log4j-${log4j.version}.jar</em> or
|
||||
<em>slf4j-api-${project.version}.jar</em> is not wrong and may
|
||||
be necessary to impose the correct version of said artifacts by
|
||||
virtue of Maven's "nearest definition" dependency mediation
|
||||
rule.</p>
|
||||
|
||||
<pre class="prettyprint source"><dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
|
|
@ -313,7 +325,12 @@ SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further detail
|
|||
"org.slf4j:slf4j-jdk14" as a dependency in your <em>pom.xml</em>
|
||||
file as shown below. In addition to
|
||||
<em>slf4j-jdk14-${project.version}.jar</em>, this will pull
|
||||
<em>slf4j-api-${project.version}.jar</em> into your project.</p>
|
||||
<em>slf4j-api-${project.version}.jar</em> into your project.
|
||||
Note that explicitly declaring a dependency on
|
||||
<em>slf4j-api-${project.version}.jar</em> is not wrong and may
|
||||
be necessary to impose the correct version of said artifact by
|
||||
virtue of Maven's "nearest definition" dependency mediation
|
||||
rule.</p>
|
||||
|
||||
<pre class="prettyprint source"><dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
|
|
|
|||
|
|
@ -29,6 +29,16 @@
|
|||
|
||||
<hr noshade="noshade" size="1"/>
|
||||
|
||||
<h3>14th of September, 2012 - Release of SLF4J 1.7.2</h3>
|
||||
|
||||
<p>Fixed <a
|
||||
href="http://bugzilla.slf4j.org/show_bug.cgi?id=272">bug
|
||||
272</a>. All <code>Logger</code> implementations shipping with
|
||||
SLF4J use <code>Object...</code> instead of <code>Object[]</code>
|
||||
to avoid compiler warnings.</p>
|
||||
|
||||
<hr noshade="noshade" size="1"/>
|
||||
|
||||
<h3>14th of September, 2012 - Release of SLF4J 1.7.1</h3>
|
||||
|
||||
<p><a
|
||||
|
|
|
|||
Loading…
Reference in New Issue