From 592868b494f1f116a76450dda2c759bf478dbded Mon Sep 17 00:00:00 2001
From: Thomas Neidhart Implementation of commons-logging Log interface that delegates all
+ * Implementation of commons-logging Log interface that delegates all
* logging calls to the Avalon logging abstraction: the Logger interface.
- *
* There are two ways in which this class can be used:
- *
*
AvalonLogger
+ * sets the ancestral Avalon logger for this class. Any AvalonLogger
* instances created through the LogFactory mechanisms will output
* to child loggers of this Logger.
*
AvalonLogger that outputs to the given
* Logger instance.
+ *
* @param logger the Avalon logger implementation to delegate to
*/
public AvalonLogger(Logger logger) {
@@ -71,6 +70,7 @@ public class AvalonLogger implements Log {
/**
* Constructs an AvalonLogger that will log to a child
* of the Logger set by calling {@link #setDefaultLogger}.
+ *
* @param name the name of the avalon logger implementation to delegate to
*/
public AvalonLogger(String name) {
@@ -81,6 +81,7 @@ public class AvalonLogger implements Log {
/**
* Gets the Avalon logger implementation used to perform logging.
+ *
* @return avalon logger implementation
*/
public Logger getLogger() {
@@ -88,9 +89,9 @@ public class AvalonLogger implements Log {
}
/**
- * Sets the ancesteral Avalon logger from which the delegating loggers
- * will descend.
- * @param logger the default avalon logger,
+ * Sets the ancestral Avalon logger from which the delegating loggers will descend.
+ *
+ * @param logger the default avalon logger,
* in case there is no logger instance supplied in constructor
*/
public static void setDefaultLogger(Logger logger) {
@@ -98,8 +99,7 @@ public class AvalonLogger implements Log {
}
/**
- * Logs a message with
- * org.apache.avalon.framework.logger.Logger.debug.
+ * Logs a message with org.apache.avalon.framework.logger.Logger.debug.
*
* @param message to log
* @param t log this cause
@@ -110,8 +110,7 @@ public class AvalonLogger implements Log {
}
/**
- * Logs a message with
- * org.apache.avalon.framework.logger.Logger.debug.
+ * Logs a message with org.apache.avalon.framework.logger.Logger.debug.
*
* @param message to log.
* @see org.apache.commons.logging.Log#debug(Object)
@@ -121,8 +120,7 @@ public class AvalonLogger implements Log {
}
/**
- * Logs a message with
- * org.apache.avalon.framework.logger.Logger.error.
+ * Logs a message with org.apache.avalon.framework.logger.Logger.error.
*
* @param message to log
* @param t log this cause
@@ -133,8 +131,7 @@ public class AvalonLogger implements Log {
}
/**
- * Logs a message with
- * org.apache.avalon.framework.logger.Logger.error.
+ * Logs a message with org.apache.avalon.framework.logger.Logger.error.
*
* @param message to log
* @see org.apache.commons.logging.Log#error(Object)
@@ -144,8 +141,7 @@ public class AvalonLogger implements Log {
}
/**
- * Logs a message with
- * org.apache.avalon.framework.logger.Logger.fatalError.
+ * Logs a message with org.apache.avalon.framework.logger.Logger.fatalError.
*
* @param message to log.
* @param t log this cause.
@@ -156,8 +152,7 @@ public class AvalonLogger implements Log {
}
/**
- * Logs a message with
- * org.apache.avalon.framework.logger.Logger.fatalError.
+ * Logs a message with org.apache.avalon.framework.logger.Logger.fatalError.
*
* @param message to log
* @see org.apache.commons.logging.Log#fatal(Object)
@@ -167,8 +162,7 @@ public class AvalonLogger implements Log {
}
/**
- * Logs a message with
- * org.apache.avalon.framework.logger.Logger.info.
+ * Logs a message with org.apache.avalon.framework.logger.Logger.info.
*
* @param message to log
* @param t log this cause
@@ -179,8 +173,7 @@ public class AvalonLogger implements Log {
}
/**
- * Logs a message with
- * org.apache.avalon.framework.logger.Logger.info.
+ * Logs a message with org.apache.avalon.framework.logger.Logger.info.
*
* @param message to log
* @see org.apache.commons.logging.Log#info(Object)
@@ -190,8 +183,7 @@ public class AvalonLogger implements Log {
}
/**
- * Is logging to
- * org.apache.avalon.framework.logger.Logger.debug enabled?
+ * Is logging to org.apache.avalon.framework.logger.Logger.debug enabled?
* @see org.apache.commons.logging.Log#isDebugEnabled()
*/
public boolean isDebugEnabled() {
@@ -199,8 +191,7 @@ public class AvalonLogger implements Log {
}
/**
- * Is logging to
- * org.apache.avalon.framework.logger.Logger.error enabled?
+ * Is logging to org.apache.avalon.framework.logger.Logger.error enabled?
* @see org.apache.commons.logging.Log#isErrorEnabled()
*/
public boolean isErrorEnabled() {
@@ -208,8 +199,7 @@ public class AvalonLogger implements Log {
}
/**
- * Is logging to
- * org.apache.avalon.framework.logger.Logger.fatalError enabled?
+ * Is logging to org.apache.avalon.framework.logger.Logger.fatalError enabled?
* @see org.apache.commons.logging.Log#isFatalEnabled()
*/
public boolean isFatalEnabled() {
@@ -217,8 +207,7 @@ public class AvalonLogger implements Log {
}
/**
- * Is logging to
- * org.apache.avalon.framework.logger.Logger.info enabled?
+ * Is logging to org.apache.avalon.framework.logger.Logger.info enabled?
* @see org.apache.commons.logging.Log#isInfoEnabled()
*/
public boolean isInfoEnabled() {
@@ -226,8 +215,7 @@ public class AvalonLogger implements Log {
}
/**
- * Is logging to
- * org.apache.avalon.framework.logger.Logger.debug enabled?
+ * Is logging to org.apache.avalon.framework.logger.Logger.debug enabled?
* @see org.apache.commons.logging.Log#isTraceEnabled()
*/
public boolean isTraceEnabled() {
@@ -235,8 +223,7 @@ public class AvalonLogger implements Log {
}
/**
- * Is logging to
- * org.apache.avalon.framework.logger.Logger.warn enabled?
+ * Is logging to org.apache.avalon.framework.logger.Logger.warn enabled?
* @see org.apache.commons.logging.Log#isWarnEnabled()
*/
public boolean isWarnEnabled() {
@@ -244,8 +231,7 @@ public class AvalonLogger implements Log {
}
/**
- * Logs a message with
- * org.apache.avalon.framework.logger.Logger.debug.
+ * Logs a message with org.apache.avalon.framework.logger.Logger.debug.
*
* @param message to log.
* @param t log this cause.
@@ -256,8 +242,7 @@ public class AvalonLogger implements Log {
}
/**
- * Logs a message with
- * org.apache.avalon.framework.logger.Logger.debug.
+ * Logs a message with org.apache.avalon.framework.logger.Logger.debug.
*
* @param message to log
* @see org.apache.commons.logging.Log#trace(Object)
@@ -267,8 +252,7 @@ public class AvalonLogger implements Log {
}
/**
- * Logs a message with
- * org.apache.avalon.framework.logger.Logger.warn.
+ * Logs a message with org.apache.avalon.framework.logger.Logger.warn.
*
* @param message to log
* @param t log this cause
@@ -279,8 +263,7 @@ public class AvalonLogger implements Log {
}
/**
- * Logs a message with
- * org.apache.avalon.framework.logger.Logger.warn.
+ * Logs a message with org.apache.avalon.framework.logger.Logger.warn.
*
* @param message to log
* @see org.apache.commons.logging.Log#warn(Object)
@@ -288,5 +271,4 @@ public class AvalonLogger implements Log {
public void warn(Object message) {
if (getLogger().isWarnEnabled()) getLogger().warn(String.valueOf(message));
}
-
}
diff --git a/src/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java b/src/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java
index 9dfcd40..d6d0c9c 100644
--- a/src/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java
+++ b/src/java/org/apache/commons/logging/impl/Jdk13LumberjackLogger.java
@@ -15,10 +15,8 @@
* limitations under the License.
*/
-
package org.apache.commons.logging.impl;
-
import java.io.Serializable;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -29,7 +27,6 @@ import java.io.StringWriter;
import org.apache.commons.logging.Log;
-
/**
* Implementation of the org.apache.commons.logging.Log
* interface that wraps the standard JDK logging mechanisms that are
@@ -44,10 +41,8 @@ import org.apache.commons.logging.Log;
*/
public class Jdk13LumberjackLogger implements Log, Serializable {
-
// ----------------------------------------------------- Instance Variables
-
/**
* The underlying Logger implementation we are using.
*/
@@ -57,7 +52,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
private String sourceMethodName = "unknown";
private boolean classAndMethodFound = false;
-
/**
* This member variable simply ensures that any attempt to initialise
* this class in a pre-1.4 JVM will result in an ExceptionInInitializerError.
@@ -68,23 +62,18 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
// ----------------------------------------------------------- Constructors
-
/**
* Construct a named instance of this Logger.
*
* @param name Name of the logger to be constructed
*/
public Jdk13LumberjackLogger(String name) {
-
this.name = name;
logger = getLogger();
-
}
-
// --------------------------------------------------------- Public Methods
-
private void log( Level level, String msg, Throwable ex ) {
if( getLogger().isLoggable(level) ) {
LogRecord record = new LogRecord(level, msg);
@@ -101,8 +90,8 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
}
/**
- *
Gets the class and method by looking at the stack trace for the - * first entry that is not this class.
+ * Gets the class and method by looking at the stack trace for the + * first entry that is not this class. */ private void getClassAndMethod() { try { @@ -144,7 +133,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable { log(Level.FINE, String.valueOf(message), null); } - /** * Logs a message withjava.util.logging.Level.FINE.
*
@@ -156,7 +144,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
log(Level.FINE, String.valueOf(message), exception);
}
-
/**
* Logs a message with java.util.logging.Level.SEVERE.
*
@@ -167,7 +154,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
log(Level.SEVERE, String.valueOf(message), null);
}
-
/**
* Logs a message with java.util.logging.Level.SEVERE.
*
@@ -179,7 +165,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
log(Level.SEVERE, String.valueOf(message), exception);
}
-
/**
* Logs a message with java.util.logging.Level.SEVERE.
*
@@ -190,7 +175,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
log(Level.SEVERE, String.valueOf(message), null);
}
-
/**
* Logs a message with java.util.logging.Level.SEVERE.
*
@@ -202,7 +186,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
log(Level.SEVERE, String.valueOf(message), exception);
}
-
/**
* Return the native Logger instance we are using.
*/
@@ -213,7 +196,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
return logger;
}
-
/**
* Logs a message with java.util.logging.Level.INFO.
*
@@ -224,7 +206,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
log(Level.INFO, String.valueOf(message), null);
}
-
/**
* Logs a message with java.util.logging.Level.INFO.
*
@@ -236,7 +217,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
log(Level.INFO, String.valueOf(message), exception);
}
-
/**
* Is debug logging currently enabled?
*/
@@ -244,7 +224,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
return getLogger().isLoggable(Level.FINE);
}
-
/**
* Is error logging currently enabled?
*/
@@ -252,7 +231,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
return getLogger().isLoggable(Level.SEVERE);
}
-
/**
* Is fatal logging currently enabled?
*/
@@ -260,7 +238,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
return getLogger().isLoggable(Level.SEVERE);
}
-
/**
* Is info logging currently enabled?
*/
@@ -268,7 +245,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
return getLogger().isLoggable(Level.INFO);
}
-
/**
* Is trace logging currently enabled?
*/
@@ -276,7 +252,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
return getLogger().isLoggable(Level.FINEST);
}
-
/**
* Is warn logging currently enabled?
*/
@@ -284,7 +259,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
return getLogger().isLoggable(Level.WARNING);
}
-
/**
* Logs a message with java.util.logging.Level.FINEST.
*
@@ -295,7 +269,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
log(Level.FINEST, String.valueOf(message), null);
}
-
/**
* Logs a message with java.util.logging.Level.FINEST.
*
@@ -307,7 +280,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
log(Level.FINEST, String.valueOf(message), exception);
}
-
/**
* Logs a message with java.util.logging.Level.WARNING.
*
@@ -318,7 +290,6 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
log(Level.WARNING, String.valueOf(message), null);
}
-
/**
* Logs a message with java.util.logging.Level.WARNING.
*
@@ -329,6 +300,4 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
public void warn(Object message, Throwable exception) {
log(Level.WARNING, String.valueOf(message), exception);
}
-
-
}
diff --git a/src/java/org/apache/commons/logging/impl/Jdk14Logger.java b/src/java/org/apache/commons/logging/impl/Jdk14Logger.java
index 195af4a..edc6096 100644
--- a/src/java/org/apache/commons/logging/impl/Jdk14Logger.java
+++ b/src/java/org/apache/commons/logging/impl/Jdk14Logger.java
@@ -15,21 +15,18 @@
* limitations under the License.
*/
-
package org.apache.commons.logging.impl;
-
import java.io.Serializable;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.logging.Log;
-
/**
- * Implementation of the org.apache.commons.logging.Log
+ * Implementation of the org.apache.commons.logging.Log
* interface that wraps the standard JDK logging mechanisms that were
- * introduced in the Merlin release (JDK 1.4).
java.util.logging.Level.FINE.
*
@@ -125,7 +112,6 @@ public class Jdk14Logger implements Log, Serializable {
log(Level.FINE, String.valueOf(message), exception);
}
-
/**
* Logs a message with java.util.logging.Level.SEVERE.
*
@@ -136,7 +122,6 @@ public class Jdk14Logger implements Log, Serializable {
log(Level.SEVERE, String.valueOf(message), null);
}
-
/**
* Logs a message with java.util.logging.Level.SEVERE.
*
@@ -148,7 +133,6 @@ public class Jdk14Logger implements Log, Serializable {
log(Level.SEVERE, String.valueOf(message), exception);
}
-
/**
* Logs a message with java.util.logging.Level.SEVERE.
*
@@ -159,7 +143,6 @@ public class Jdk14Logger implements Log, Serializable {
log(Level.SEVERE, String.valueOf(message), null);
}
-
/**
* Logs a message with java.util.logging.Level.SEVERE.
*
@@ -171,7 +154,6 @@ public class Jdk14Logger implements Log, Serializable {
log(Level.SEVERE, String.valueOf(message), exception);
}
-
/**
* Return the native Logger instance we are using.
*/
@@ -182,7 +164,6 @@ public class Jdk14Logger implements Log, Serializable {
return logger;
}
-
/**
* Logs a message with java.util.logging.Level.INFO.
*
@@ -193,7 +174,6 @@ public class Jdk14Logger implements Log, Serializable {
log(Level.INFO, String.valueOf(message), null);
}
-
/**
* Logs a message with java.util.logging.Level.INFO.
*
@@ -205,7 +185,6 @@ public class Jdk14Logger implements Log, Serializable {
log(Level.INFO, String.valueOf(message), exception);
}
-
/**
* Is debug logging currently enabled?
*/
@@ -213,7 +192,6 @@ public class Jdk14Logger implements Log, Serializable {
return getLogger().isLoggable(Level.FINE);
}
-
/**
* Is error logging currently enabled?
*/
@@ -221,7 +199,6 @@ public class Jdk14Logger implements Log, Serializable {
return getLogger().isLoggable(Level.SEVERE);
}
-
/**
* Is fatal logging currently enabled?
*/
@@ -229,7 +206,6 @@ public class Jdk14Logger implements Log, Serializable {
return getLogger().isLoggable(Level.SEVERE);
}
-
/**
* Is info logging currently enabled?
*/
@@ -237,7 +213,6 @@ public class Jdk14Logger implements Log, Serializable {
return getLogger().isLoggable(Level.INFO);
}
-
/**
* Is trace logging currently enabled?
*/
@@ -245,7 +220,6 @@ public class Jdk14Logger implements Log, Serializable {
return getLogger().isLoggable(Level.FINEST);
}
-
/**
* Is warn logging currently enabled?
*/
@@ -253,7 +227,6 @@ public class Jdk14Logger implements Log, Serializable {
return getLogger().isLoggable(Level.WARNING);
}
-
/**
* Logs a message with java.util.logging.Level.FINEST.
*
@@ -264,7 +237,6 @@ public class Jdk14Logger implements Log, Serializable {
log(Level.FINEST, String.valueOf(message), null);
}
-
/**
* Logs a message with java.util.logging.Level.FINEST.
*
@@ -276,7 +248,6 @@ public class Jdk14Logger implements Log, Serializable {
log(Level.FINEST, String.valueOf(message), exception);
}
-
/**
* Logs a message with java.util.logging.Level.WARNING.
*
@@ -287,7 +258,6 @@ public class Jdk14Logger implements Log, Serializable {
log(Level.WARNING, String.valueOf(message), null);
}
-
/**
* Logs a message with java.util.logging.Level.WARNING.
*
@@ -298,6 +268,4 @@ public class Jdk14Logger implements Log, Serializable {
public void warn(Object message, Throwable exception) {
log(Level.WARNING, String.valueOf(message), exception);
}
-
-
}
diff --git a/src/java/org/apache/commons/logging/impl/Log4JLogger.java b/src/java/org/apache/commons/logging/impl/Log4JLogger.java
index 3dcdb5f..b50f929 100644
--- a/src/java/org/apache/commons/logging/impl/Log4JLogger.java
+++ b/src/java/org/apache/commons/logging/impl/Log4JLogger.java
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
package org.apache.commons.logging.impl;
import java.io.Serializable;
@@ -95,14 +94,12 @@ public class Log4JLogger implements Log, Serializable {
traceLevel = _traceLevel;
}
-
// ------------------------------------------------------------ Constructor
public Log4JLogger() {
name = null;
}
-
/**
* Base constructor.
*/
@@ -123,7 +120,6 @@ public class Log4JLogger implements Log, Serializable {
this.logger=logger;
}
-
/**
* Logs a message with org.apache.log4j.Priority.TRACE.
* When using a log4j version that does not support the TRACE
@@ -136,7 +132,6 @@ public class Log4JLogger implements Log, Serializable {
getLogger().log(FQCN, traceLevel, message, null );
}
-
/**
* Logs a message with org.apache.log4j.Priority.TRACE.
* When using a log4j version that does not support the TRACE
@@ -150,7 +145,6 @@ public class Log4JLogger implements Log, Serializable {
getLogger().log(FQCN, traceLevel, message, t );
}
-
/**
* Logs a message with org.apache.log4j.Priority.DEBUG.
*
@@ -172,7 +166,6 @@ public class Log4JLogger implements Log, Serializable {
getLogger().log(FQCN, Level.DEBUG, message, t );
}
-
/**
* Logs a message with org.apache.log4j.Priority.INFO.
*
@@ -183,7 +176,6 @@ public class Log4JLogger implements Log, Serializable {
getLogger().log(FQCN, Level.INFO, message, null );
}
-
/**
* Logs a message with org.apache.log4j.Priority.INFO.
*
@@ -195,7 +187,6 @@ public class Log4JLogger implements Log, Serializable {
getLogger().log(FQCN, Level.INFO, message, t );
}
-
/**
* Logs a message with org.apache.log4j.Priority.WARN.
*
@@ -206,7 +197,6 @@ public class Log4JLogger implements Log, Serializable {
getLogger().log(FQCN, Level.WARN, message, null );
}
-
/**
* Logs a message with org.apache.log4j.Priority.WARN.
*
@@ -218,7 +208,6 @@ public class Log4JLogger implements Log, Serializable {
getLogger().log(FQCN, Level.WARN, message, t );
}
-
/**
* Logs a message with org.apache.log4j.Priority.ERROR.
*
@@ -229,7 +218,6 @@ public class Log4JLogger implements Log, Serializable {
getLogger().log(FQCN, Level.ERROR, message, null );
}
-
/**
* Logs a message with org.apache.log4j.Priority.ERROR.
*
@@ -241,7 +229,6 @@ public class Log4JLogger implements Log, Serializable {
getLogger().log(FQCN, Level.ERROR, message, t );
}
-
/**
* Logs a message with org.apache.log4j.Priority.FATAL.
*
@@ -252,7 +239,6 @@ public class Log4JLogger implements Log, Serializable {
getLogger().log(FQCN, Level.FATAL, message, null );
}
-
/**
* Logs a message with org.apache.log4j.Priority.FATAL.
*
@@ -264,7 +250,6 @@ public class Log4JLogger implements Log, Serializable {
getLogger().log(FQCN, Level.FATAL, message, t );
}
-
/**
* Return the native Logger instance we are using.
*/
@@ -275,7 +260,6 @@ public class Log4JLogger implements Log, Serializable {
return this.logger;
}
-
/**
* Check whether the Log4j Logger used is enabled for DEBUG priority.
*/
@@ -283,15 +267,13 @@ public class Log4JLogger implements Log, Serializable {
return getLogger().isDebugEnabled();
}
-
- /**
+ /**
* Check whether the Log4j Logger used is enabled for ERROR priority.
*/
public boolean isErrorEnabled() {
return getLogger().isEnabledFor(Level.ERROR);
}
-
/**
* Check whether the Log4j Logger used is enabled for FATAL priority.
*/
@@ -299,7 +281,6 @@ public class Log4JLogger implements Log, Serializable {
return getLogger().isEnabledFor(Level.FATAL);
}
-
/**
* Check whether the Log4j Logger used is enabled for INFO priority.
*/
@@ -307,7 +288,6 @@ public class Log4JLogger implements Log, Serializable {
return getLogger().isInfoEnabled();
}
-
/**
* Check whether the Log4j Logger used is enabled for TRACE priority.
* When using a log4j version that does not support the TRACE level, this call
diff --git a/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java b/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java
index f0354aa..6bc7690 100644
--- a/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java
+++ b/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java
@@ -17,7 +17,6 @@
package org.apache.commons.logging.impl;
-
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -30,7 +29,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogConfigurationException;
import org.apache.commons.logging.LogFactory;
-
/**
* Concrete subclass of {@link LogFactory} that implements the
* following algorithm to dynamically select a logging implementation
@@ -67,7 +65,6 @@ import org.apache.commons.logging.LogFactory;
*/
public class LogFactoryImpl extends LogFactory {
-
/** Log4JLogger class name */
private static final String LOGGING_IMPL_LOG4J_LOGGER = "org.apache.commons.logging.impl.Log4JLogger";
/** Jdk14Logger class name */
@@ -82,8 +79,6 @@ public class LogFactoryImpl extends LogFactory {
// ----------------------------------------------------------- Constructors
-
-
/**
* Public no-arguments constructor required by the lookup mechanism.
*/
@@ -95,24 +90,19 @@ public class LogFactoryImpl extends LogFactory {
}
}
-
// ----------------------------------------------------- Manifest Constants
-
/**
* The name (org.apache.commons.logging.Log) of the system
* property identifying our {@link Log} implementation class.
*/
- public static final String LOG_PROPERTY =
- "org.apache.commons.logging.Log";
-
+ public static final String LOG_PROPERTY = "org.apache.commons.logging.Log";
/**
* The deprecated system property used for backwards compatibility with
* old versions of JCL.
*/
- protected static final String LOG_PROPERTY_OLD =
- "org.apache.commons.logging.log";
+ protected static final String LOG_PROPERTY_OLD = "org.apache.commons.logging.log";
/**
* The name (org.apache.commons.logging.Log.allowFlawedContext)
@@ -161,7 +151,6 @@ public class LogFactoryImpl extends LogFactory {
public static final String ALLOW_FLAWED_HIERARCHY_PROPERTY =
"org.apache.commons.logging.Log.allowFlawedHierarchy";
-
/**
* The names of classes that will be tried (in order) as logging
* adapters. Each class is expected to implement the Log interface,
@@ -177,7 +166,6 @@ public class LogFactoryImpl extends LogFactory {
"org.apache.commons.logging.impl.SimpleLog"
};
-
// ----------------------------------------------------- Instance Variables
/**
@@ -191,26 +179,22 @@ public class LogFactoryImpl extends LogFactory {
*/
private String diagnosticPrefix;
-
/**
* Configuration attributes.
*/
protected Hashtable attributes = new Hashtable();
-
/**
* The {@link org.apache.commons.logging.Log} instances that have
* already been created, keyed by logger name.
*/
protected Hashtable instances = new Hashtable();
-
/**
* Name of the class implementing the Log interface.
*/
private String logClassName;
-
/**
* The one-argument constructor of the
* {@link org.apache.commons.logging.Log}
@@ -220,13 +204,10 @@ public class LogFactoryImpl extends LogFactory {
*/
protected Constructor logConstructor = null;
-
/**
* The signature of the Constructor to be used.
*/
- protected Class logConstructorSignature[] =
- { java.lang.String.class };
-
+ protected Class logConstructorSignature[] = { java.lang.String.class };
/**
* The one-argument setLogFactory method of the selected
@@ -234,12 +215,10 @@ public class LogFactoryImpl extends LogFactory {
*/
protected Method logMethod = null;
-
/**
* The signature of the setLogFactory method to be used.
*/
- protected Class logMethodSignature[] =
- { LogFactory.class };
+ protected Class logMethodSignature[] = { LogFactory.class };
/**
* See getBaseClassLoader and initConfiguration.
@@ -258,7 +237,6 @@ public class LogFactoryImpl extends LogFactory {
// --------------------------------------------------------- Public Methods
-
/**
* Return the configuration attribute with the specified name (if any),
* or null if there is no such attribute.
@@ -266,12 +244,9 @@ public class LogFactoryImpl extends LogFactory {
* @param name Name of the attribute to return
*/
public Object getAttribute(String name) {
-
return attributes.get(name);
-
}
-
/**
* Return an array containing the names of all currently defined
* configuration attributes. If there are no such attributes, a zero
@@ -281,7 +256,6 @@ public class LogFactoryImpl extends LogFactory {
return (String[]) attributes.keySet().toArray(new String[attributes.size()]);
}
-
/**
* Convenience method to derive a name from the specified class and
* call getInstance(String) with it.
@@ -292,12 +266,9 @@ public class LogFactoryImpl extends LogFactory {
* instance cannot be returned
*/
public Log getInstance(Class clazz) throws LogConfigurationException {
-
return getInstance(clazz.getName());
-
}
-
/**
*
Construct (if necessary) and return a Log instance,
* using the factory's current set of configuration attributes.
null value is equivalent to calling
@@ -380,7 +344,6 @@ public class LogFactoryImpl extends LogFactory {
* to remove any setting for this attribute
*/
public void setAttribute(String name, Object value) {
-
if (logConstructor != null) {
logDiagnostic("setAttribute: call too late; configuration already performed.");
}
@@ -394,10 +357,8 @@ public class LogFactoryImpl extends LogFactory {
if (name.equals(TCCL_KEY)) {
useTCCL = value != null && Boolean.valueOf(value.toString()).booleanValue();
}
-
}
-
// ------------------------------------------------------
// Static Methods
//
@@ -413,7 +374,6 @@ public class LogFactoryImpl extends LogFactory {
protected static ClassLoader getContextClassLoader() throws LogConfigurationException {
return LogFactory.getContextClassLoader();
}
-
/**
* Workaround for bug in Java1.2; in theory this method is not needed.
@@ -422,7 +382,6 @@ public class LogFactoryImpl extends LogFactory {
protected static boolean isDiagnosticsEnabled() {
return LogFactory.isDiagnosticsEnabled();
}
-
/**
* Workaround for bug in Java1.2; in theory this method is not needed.
@@ -433,7 +392,6 @@ public class LogFactoryImpl extends LogFactory {
return LogFactory.getClassLoader(clazz);
}
-
// ------------------------------------------------------ Protected Methods
/**
@@ -472,7 +430,6 @@ public class LogFactoryImpl extends LogFactory {
}
diagnosticPrefix = "[LogFactoryImpl@" + System.identityHashCode(this) + " from " + classLoaderName + "] ";
}
-
/**
* Output a diagnostic message to a user-specified destination (if the
@@ -495,7 +452,6 @@ public class LogFactoryImpl extends LogFactory {
* it will be.
*/
protected String getLogClassName() {
-
if (logClassName == null) {
discoverLogImplementation(getClass().getName());
}
@@ -529,7 +485,6 @@ public class LogFactoryImpl extends LogFactory {
return logConstructor;
}
-
/**
* Is JDK 1.3 with Lumberjack logging available?
@@ -543,7 +498,6 @@ public class LogFactoryImpl extends LogFactory {
"org.apache.commons.logging.impl.Jdk13LumberjackLogger");
}
-
/**
* Return true if JDK 1.4 or later logging
* is available. Also checks that the Throwable class
@@ -559,7 +513,6 @@ public class LogFactoryImpl extends LogFactory {
"org.apache.commons.logging.impl.Jdk14Logger");
}
-
/**
* Is a Log4J implementation available?
*
@@ -572,7 +525,6 @@ public class LogFactoryImpl extends LogFactory {
LOGGING_IMPL_LOG4J_LOGGER);
}
-
/**
* Create and return a new {@link org.apache.commons.logging.Log}
* instance for the specified name.
@@ -583,7 +535,6 @@ public class LogFactoryImpl extends LogFactory {
* be created
*/
protected Log newInstance(String name) throws LogConfigurationException {
-
Log instance;
try {
if (logConstructor == null) {
@@ -619,7 +570,6 @@ public class LogFactoryImpl extends LogFactory {
throw new LogConfigurationException(t);
}
}
-
// ------------------------------------------------------ Private Methods
@@ -642,7 +592,7 @@ public class LogFactoryImpl extends LogFactory {
* allow this class to access the context classloader.
*/
private static ClassLoader getContextClassLoaderInternal()
- throws LogConfigurationException {
+ throws LogConfigurationException {
return (ClassLoader)AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
@@ -661,7 +611,7 @@ public class LogFactoryImpl extends LogFactory {
* info to access data that should not be available to it.
*/
private static String getSystemProperty(final String key, final String def)
- throws SecurityException {
+ throws SecurityException {
return (String) AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
@@ -806,7 +756,6 @@ public class LogFactoryImpl extends LogFactory {
allowFlawedDiscovery = getBooleanConfiguration(ALLOW_FLAWED_DISCOVERY_PROPERTY, true);
allowFlawedHierarchy = getBooleanConfiguration(ALLOW_FLAWED_HIERARCHY_PROPERTY, true);
}
-
/**
* Attempts to create a Log instance for the given category name.
@@ -818,8 +767,7 @@ public class LogFactoryImpl extends LogFactory {
* or if no adapter at all can be instantiated
*/
private Log discoverLogImplementation(String logCategory)
- throws LogConfigurationException
- {
+ throws LogConfigurationException {
if (isDiagnosticsEnabled()) {
logDiagnostic("Discovering a Log implementation...");
}
@@ -902,7 +850,6 @@ public class LogFactoryImpl extends LogFactory {
return result;
}
-
/**
* Appends message if the given name is similar to the candidate.
* @param messageBuffer StringBuffer the message should be appended to,
@@ -928,7 +875,6 @@ public class LogFactoryImpl extends LogFactory {
}
}
-
/**
* Checks system properties and the attribute map for
* a Log implementation specified by the user under the
@@ -936,8 +882,7 @@ public class LogFactoryImpl extends LogFactory {
*
* @return classname specified by the user, or null
*/
- private String findUserSpecifiedLogClassName()
- {
+ private String findUserSpecifiedLogClassName() {
if (isDiagnosticsEnabled()) {
logDiagnostic("Trying to get log class from attribute '" + LOG_PROPERTY + "'");
}
@@ -990,7 +935,6 @@ public class LogFactoryImpl extends LogFactory {
return specifiedClass;
}
-
/**
* Attempts to load the given class, find a suitable constructor,
@@ -1014,7 +958,7 @@ public class LogFactoryImpl extends LogFactory {
private Log createLogFromClass(String logAdapterClassName,
String logCategory,
boolean affectState)
- throws LogConfigurationException {
+ throws LogConfigurationException {
if (isDiagnosticsEnabled()) {
logDiagnostic("Attempting to instantiate '" + logAdapterClassName + "'");
@@ -1196,7 +1140,6 @@ public class LogFactoryImpl extends LogFactory {
return logAdapter;
}
-
/**
* Return the classloader from which we should try to load the logging
* adapter classes.
@@ -1373,7 +1316,6 @@ public class LogFactoryImpl extends LogFactory {
throw new LogConfigurationException(discoveryFlaw);
}
}
-
/**
* Report a problem loading the log adapter, then either return
@@ -1402,7 +1344,7 @@ public class LogFactoryImpl extends LogFactory {
* should not be recovered from.
*/
private void handleFlawedHierarchy(ClassLoader badClassLoader, Class badClass)
- throws LogConfigurationException {
+ throws LogConfigurationException {
boolean implementsLog = false;
String logInterfaceName = Log.class.getName();
diff --git a/src/java/org/apache/commons/logging/impl/LogKitLogger.java b/src/java/org/apache/commons/logging/impl/LogKitLogger.java
index a9fd836..ecf4e89 100644
--- a/src/java/org/apache/commons/logging/impl/LogKitLogger.java
+++ b/src/java/org/apache/commons/logging/impl/LogKitLogger.java
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
package org.apache.commons.logging.impl;
import java.io.Serializable;
@@ -24,14 +23,13 @@ import org.apache.log.Hierarchy;
import org.apache.commons.logging.Log;
/**
- *
Implementation of org.apache.commons.logging.Log
+ * Implementation of org.apache.commons.logging.Log
* that wraps the avalon-logkit
* logging system. Configuration of LogKit is left to the user.
- *
LogKit accepts only String messages.
+ *
+ * LogKit accepts only String messages.
* Therefore, this implementation converts object messages into strings
- * by called their toString() method before logging them.
toString() method before logging them.
*
* @author Scott Sanders
* @author Robert Burrell Donkin
@@ -39,20 +37,16 @@ import org.apache.commons.logging.Log;
*/
public class LogKitLogger implements Log, Serializable {
-
// ------------------------------------------------------------- Attributes
-
/** Logging goes to this LogKit logger */
protected transient Logger logger = null;
/** Name of this logger */
protected String name = null;
-
// ------------------------------------------------------------ Constructor
-
/**
* Construct LogKitLogger which wraps the LogKit
* logger with given name.
@@ -64,12 +58,10 @@ public class LogKitLogger implements Log, Serializable {
this.logger = getLogger();
}
-
// --------------------------------------------------------- Public Methods
-
/**
- * Return the underlying Logger we are using.
+ * Return the underlying Logger we are using. */ public Logger getLogger() { @@ -80,10 +72,8 @@ public class LogKitLogger implements Log, Serializable { } - // ----------------------------------------------------- Log Implementation - /** * Logs a message withorg.apache.log.Priority.DEBUG.
*
@@ -94,7 +84,6 @@ public class LogKitLogger implements Log, Serializable {
debug(message);
}
-
/**
* Logs a message with org.apache.log.Priority.DEBUG.
*
@@ -106,7 +95,6 @@ public class LogKitLogger implements Log, Serializable {
debug(message, t);
}
-
/**
* Logs a message with org.apache.log.Priority.DEBUG.
*
@@ -119,7 +107,6 @@ public class LogKitLogger implements Log, Serializable {
}
}
-
/**
* Logs a message with org.apache.log.Priority.DEBUG.
*
@@ -133,7 +120,6 @@ public class LogKitLogger implements Log, Serializable {
}
}
-
/**
* Logs a message with org.apache.log.Priority.INFO.
*
@@ -146,7 +132,6 @@ public class LogKitLogger implements Log, Serializable {
}
}
-
/**
* Logs a message with org.apache.log.Priority.INFO.
*
@@ -160,7 +145,6 @@ public class LogKitLogger implements Log, Serializable {
}
}
-
/**
* Logs a message with org.apache.log.Priority.WARN.
*
@@ -173,7 +157,6 @@ public class LogKitLogger implements Log, Serializable {
}
}
-
/**
* Logs a message with org.apache.log.Priority.WARN.
*
@@ -187,7 +170,6 @@ public class LogKitLogger implements Log, Serializable {
}
}
-
/**
* Logs a message with org.apache.log.Priority.ERROR.
*
@@ -200,7 +182,6 @@ public class LogKitLogger implements Log, Serializable {
}
}
-
/**
* Logs a message with org.apache.log.Priority.ERROR.
*
@@ -214,7 +195,6 @@ public class LogKitLogger implements Log, Serializable {
}
}
-
/**
* Logs a message with org.apache.log.Priority.FATAL_ERROR.
*
@@ -227,7 +207,6 @@ public class LogKitLogger implements Log, Serializable {
}
}
-
/**
* Logs a message with org.apache.log.Priority.FATAL_ERROR.
*
@@ -241,7 +220,6 @@ public class LogKitLogger implements Log, Serializable {
}
}
-
/**
* Checks whether the LogKit logger will log messages of priority DEBUG.
*/
@@ -249,7 +227,6 @@ public class LogKitLogger implements Log, Serializable {
return getLogger().isDebugEnabled();
}
-
/**
* Checks whether the LogKit logger will log messages of priority ERROR.
*/
@@ -257,7 +234,6 @@ public class LogKitLogger implements Log, Serializable {
return getLogger().isErrorEnabled();
}
-
/**
* Checks whether the LogKit logger will log messages of priority FATAL_ERROR.
*/
@@ -265,7 +241,6 @@ public class LogKitLogger implements Log, Serializable {
return getLogger().isFatalErrorEnabled();
}
-
/**
* Checks whether the LogKit logger will log messages of priority INFO.
*/
@@ -273,7 +248,6 @@ public class LogKitLogger implements Log, Serializable {
return getLogger().isInfoEnabled();
}
-
/**
* Checks whether the LogKit logger will log messages of priority DEBUG.
*/
@@ -281,13 +255,10 @@ public class LogKitLogger implements Log, Serializable {
return getLogger().isDebugEnabled();
}
-
/**
* Checks whether the LogKit logger will log messages of priority WARN.
*/
public boolean isWarnEnabled() {
return getLogger().isWarnEnabled();
}
-
-
}
diff --git a/src/java/org/apache/commons/logging/impl/NoOpLog.java b/src/java/org/apache/commons/logging/impl/NoOpLog.java
index 3a8d10f..32afc61 100644
--- a/src/java/org/apache/commons/logging/impl/NoOpLog.java
+++ b/src/java/org/apache/commons/logging/impl/NoOpLog.java
@@ -15,17 +15,14 @@
* limitations under the License.
*/
-
package org.apache.commons.logging.impl;
-
import java.io.Serializable;
import org.apache.commons.logging.Log;
-
/**
- * Trivial implementation of Log that throws away all messages. No - * configurable system properties are supported.
+ * Trivial implementation of Log that throws away all messages. No + * configurable system properties are supported. * * @author Scott Sanders * @author Rod Waldhoff @@ -103,5 +100,4 @@ public class NoOpLog implements Log, Serializable { * @return false */ public final boolean isWarnEnabled() { return false; } - } diff --git a/src/java/org/apache/commons/logging/impl/ServletContextCleaner.java b/src/java/org/apache/commons/logging/impl/ServletContextCleaner.java index d24fc0f..8de06ef 100644 --- a/src/java/org/apache/commons/logging/impl/ServletContextCleaner.java +++ b/src/java/org/apache/commons/logging/impl/ServletContextCleaner.java @@ -15,7 +15,6 @@ * limitations under the License. */ - package org.apache.commons.logging.impl; import java.lang.reflect.InvocationTargetException; @@ -26,7 +25,6 @@ import javax.servlet.ServletContextListener; import org.apache.commons.logging.LogFactory; - /** * This class is capable of receiving notifications about the undeployment of * a webapp, and responds by ensuring that commons-logging releases all diff --git a/src/java/org/apache/commons/logging/impl/SimpleLog.java b/src/java/org/apache/commons/logging/impl/SimpleLog.java index 749f9e9..cdb587a 100644 --- a/src/java/org/apache/commons/logging/impl/SimpleLog.java +++ b/src/java/org/apache/commons/logging/impl/SimpleLog.java @@ -15,7 +15,6 @@ * limitations under the License. */ - package org.apache.commons.logging.impl; import java.io.InputStream; @@ -75,29 +74,29 @@ import org.apache.commons.logging.LogConfigurationException; */ public class SimpleLog implements Log, Serializable { - // ------------------------------------------------------- Class Attributes /** All system properties used bySimpleLog start with this */
- static protected final String systemPrefix =
- "org.apache.commons.logging.simplelog.";
+ static protected final String systemPrefix = "org.apache.commons.logging.simplelog.";
/** Properties loaded from simplelog.properties */
static protected final Properties simpleLogProps = new Properties();
/** The default format to use when formating dates */
- static protected final String DEFAULT_DATE_TIME_FORMAT =
- "yyyy/MM/dd HH:mm:ss:SSS zzz";
+ static protected final String DEFAULT_DATE_TIME_FORMAT = "yyyy/MM/dd HH:mm:ss:SSS zzz";
/** Include the instance name in the log message? */
static protected boolean showLogName = false;
+
/** Include the short name ( last component ) of the logger in the log
* message. Defaults to true - otherwise we'll be lost in a flood of
* messages without knowing who sends them.
*/
static protected boolean showShortName = true;
+
/** Include the current time in the log message */
static protected boolean showDateTime = false;
+
/** The date and time format to use in the log message */
static protected String dateTimeFormat = DEFAULT_DATE_TIME_FORMAT;
@@ -113,7 +112,6 @@ public class SimpleLog implements Log, Serializable {
// ---------------------------------------------------- Log Level Constants
-
/** "Trace" level logging. */
public static final int LOG_LEVEL_TRACE = 1;
/** "Debug" level logging. */
@@ -196,7 +194,6 @@ public class SimpleLog implements Log, Serializable {
/** The short name of this simple log instance */
private String shortLogName = null;
-
// ------------------------------------------------------------ Constructor
/**
@@ -246,7 +243,6 @@ public class SimpleLog implements Log, Serializable {
}
-
// -------------------------------------------------------- Properties
/**
@@ -260,23 +256,20 @@ public class SimpleLog implements Log, Serializable {
}
-
/**
- * Get logging level.
+ * Get logging level. */ public int getLevel() { - return currentLogLevel; } - // -------------------------------------------------------- Logging Methods - /** - * Do the actual logging.
- * This method assembles the message
- * and then calls write() to cause it to be written.
+ * This method assembles the message and then calls write()
+ * to cause it to be written.
*
* @param type One of the LOG_LEVEL_XXX constants defining the log level
* @param message The message itself (typically a String)
@@ -337,10 +330,8 @@ public class SimpleLog implements Log, Serializable {
// Print to the appropriate destination
write(buf);
-
}
-
/**
*
Write the content of the message accumulated in the specified
* StringBuffer to the appropriate output destination. The
@@ -350,12 +341,9 @@ public class SimpleLog implements Log, Serializable {
* text to be logged
*/
protected void write(StringBuffer buffer) {
-
System.err.println(buffer.toString());
-
}
-
/**
* Is the given log level currently enabled?
*
@@ -367,10 +355,8 @@ public class SimpleLog implements Log, Serializable {
return logLevel >= currentLogLevel;
}
-
// -------------------------------------------------------- Log Implementation
-
/**
* Logs a message with
* org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_DEBUG.
@@ -379,13 +365,11 @@ public class SimpleLog implements Log, Serializable {
* @see org.apache.commons.logging.Log#debug(Object)
*/
public final void debug(Object message) {
-
if (isLevelEnabled(SimpleLog.LOG_LEVEL_DEBUG)) {
log(SimpleLog.LOG_LEVEL_DEBUG, message, null);
}
}
-
/**
* Logs a message with
* org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_DEBUG.
@@ -395,246 +379,202 @@ public class SimpleLog implements Log, Serializable {
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
*/
public final void debug(Object message, Throwable t) {
-
if (isLevelEnabled(SimpleLog.LOG_LEVEL_DEBUG)) {
log(SimpleLog.LOG_LEVEL_DEBUG, message, t);
}
}
-
/**
- * Logs a message with
- * org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_TRACE.
+ * Logs a message with org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_TRACE.
*
* @param message to log
* @see org.apache.commons.logging.Log#trace(Object)
*/
public final void trace(Object message) {
-
if (isLevelEnabled(SimpleLog.LOG_LEVEL_TRACE)) {
log(SimpleLog.LOG_LEVEL_TRACE, message, null);
}
}
-
/**
- * Logs a message with
- * org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_TRACE.
+ * Logs a message with org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_TRACE.
*
* @param message to log
* @param t log this cause
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
*/
public final void trace(Object message, Throwable t) {
-
if (isLevelEnabled(SimpleLog.LOG_LEVEL_TRACE)) {
log(SimpleLog.LOG_LEVEL_TRACE, message, t);
}
}
-
/**
- * Logs a message with
- * org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_INFO.
+ * Logs a message with org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_INFO.
*
* @param message to log
* @see org.apache.commons.logging.Log#info(Object)
*/
public final void info(Object message) {
-
if (isLevelEnabled(SimpleLog.LOG_LEVEL_INFO)) {
log(SimpleLog.LOG_LEVEL_INFO,message,null);
}
}
-
/**
- * Logs a message with
- * org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_INFO.
+ * Logs a message with org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_INFO.
*
* @param message to log
* @param t log this cause
* @see org.apache.commons.logging.Log#info(Object, Throwable)
*/
public final void info(Object message, Throwable t) {
-
if (isLevelEnabled(SimpleLog.LOG_LEVEL_INFO)) {
log(SimpleLog.LOG_LEVEL_INFO, message, t);
}
}
-
/**
- * Logs a message with
- * org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_WARN.
+ * Logs a message with org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_WARN.
*
* @param message to log
* @see org.apache.commons.logging.Log#warn(Object)
*/
public final void warn(Object message) {
-
if (isLevelEnabled(SimpleLog.LOG_LEVEL_WARN)) {
log(SimpleLog.LOG_LEVEL_WARN, message, null);
}
}
-
/**
- * Logs a message with
- * org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_WARN.
+ * Logs a message with org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_WARN.
*
* @param message to log
* @param t log this cause
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
*/
public final void warn(Object message, Throwable t) {
-
if (isLevelEnabled(SimpleLog.LOG_LEVEL_WARN)) {
log(SimpleLog.LOG_LEVEL_WARN, message, t);
}
}
-
/**
- * Logs a message with
- * org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_ERROR.
+ * Logs a message with org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_ERROR.
*
* @param message to log
* @see org.apache.commons.logging.Log#error(Object)
*/
public final void error(Object message) {
-
if (isLevelEnabled(SimpleLog.LOG_LEVEL_ERROR)) {
log(SimpleLog.LOG_LEVEL_ERROR, message, null);
}
}
-
/**
- * Logs a message with
- * org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_ERROR.
+ * Logs a message with org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_ERROR.
*
* @param message to log
* @param t log this cause
* @see org.apache.commons.logging.Log#error(Object, Throwable)
*/
public final void error(Object message, Throwable t) {
-
if (isLevelEnabled(SimpleLog.LOG_LEVEL_ERROR)) {
log(SimpleLog.LOG_LEVEL_ERROR, message, t);
}
}
-
/**
- * Log a message with
- * org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_FATAL.
+ * Log a message with org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_FATAL.
*
* @param message to log
* @see org.apache.commons.logging.Log#fatal(Object)
*/
public final void fatal(Object message) {
-
if (isLevelEnabled(SimpleLog.LOG_LEVEL_FATAL)) {
log(SimpleLog.LOG_LEVEL_FATAL, message, null);
}
}
-
/**
- * Logs a message with
- * org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_FATAL.
+ * Logs a message with org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_FATAL.
*
* @param message to log
* @param t log this cause
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
*/
public final void fatal(Object message, Throwable t) {
-
if (isLevelEnabled(SimpleLog.LOG_LEVEL_FATAL)) {
log(SimpleLog.LOG_LEVEL_FATAL, message, t);
}
}
-
/**
- *
Are debug messages currently enabled?
- * - * This allows expensive operations such as String
+ * Are debug messages currently enabled?
+ *
+ * This allows expensive operations such as String
* concatenation to be avoided when the message will be ignored by the
- * logger.
Are error messages currently enabled?
- * - * This allows expensive operations such as String
+ * Are error messages currently enabled?
+ *
+ * This allows expensive operations such as String
* concatenation to be avoided when the message will be ignored by the
- * logger.
Are fatal messages currently enabled?
- * - * This allows expensive operations such as String
+ * Are fatal messages currently enabled?
+ *
+ * This allows expensive operations such as String
* concatenation to be avoided when the message will be ignored by the
- * logger.
Are info messages currently enabled?
- * - * This allows expensive operations such as String
+ * Are info messages currently enabled?
+ *
+ * This allows expensive operations such as String
* concatenation to be avoided when the message will be ignored by the
- * logger.
Are trace messages currently enabled?
- * - * This allows expensive operations such as String
+ * Are trace messages currently enabled?
+ *
+ * This allows expensive operations such as String
* concatenation to be avoided when the message will be ignored by the
- * logger.
Are warn messages currently enabled?
- * - * This allows expensive operations such as String
+ * Are warn messages currently enabled?
+ *
+ * This allows expensive operations such as String
* concatenation to be avoided when the message will be ignored by the
- * logger.