From 731ec59f35ed5f1385290337d2e9205b0adf4d30 Mon Sep 17 00:00:00 2001
From: Robert Burrell Donkin
The log level determines whether a particular message
- * should be passed to the logging implementation.
- * Log levels are ordered numerically.
- * For example, if the log level is warn
- * then the message passed to {@link #error} will be passed to the logging
- * implementation but if the log level is fatal or higher
- * then the message will not.
The five logging levels used by Log are (in order):
+ *
The logging level constants are provided for the convenience of - * {@link Log} implementations that wish to support dynamic changes in the - * logging level configuration. However, configuration will generally be done + *
Performance is often a logging concern. + * By examining the appropriate property, + * a component can avoid expensive operations (producing information + * to be logged).
+ * + * For example,
+ *
+ *
+ * if (log.isDebugEnabled()) {
+ * ... do something expensive ...
+ * log.debug(theResult);
+ * }
+ *
Configuration of the underlying logging system will generally be done * external to the Logging APIs, through whatever mechanism is supported by - * the underlying logging implementation in use.
+ * that system. * * @author Rod Waldhoff - * @version $Id: Log.java,v 1.10 2002/01/17 22:55:43 rdonkin Exp $ + * @version $Id: Log.java,v 1.11 2002/01/23 20:14:30 rdonkin Exp $ */ public interface Log { @@ -146,60 +163,85 @@ public interface Log { /** *Log a message with debug log level
+ * + * @param message log this message */ public void debug(Object message); /** *Log an error with debug log level
+ * + * @param message log this message + * @param t log this cause */ public void debug(Object message, Throwable t); /** *Log a message with info log level
+ * + * @param message log this message */ public void info(Object message); /** *Log an error with info log level
+ * + * @param message log this message + * @param t log this cause */ public void info(Object message, Throwable t); /** *Log a message with warn log level
+ * + * @param message log this message */ public void warn(Object message); /** *Log an error with warn log level
+ * + * @param message log this message + * @param t log this cause */ public void warn(Object message, Throwable t); /** *Log a message with error log level
+ * + * @param message log this message */ public void error(Object message); /** *Log an error with error log level
+ * + * @param message log this message + * @param t log this cause */ public void error(Object message, Throwable t); /** *Log a message with fatal log level
+ * + * @param message log this message */ public void fatal(Object message); /** *Log an error with fatal log level
+ * + * @param message log this message + * @param t log this cause */ public void fatal(Object message, Throwable t);