You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2002/07/12 19:56:23 UTC
cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/log Log.java
costin 2002/07/12 10:56:23
Modified: util/java/org/apache/tomcat/util/log Log.java
Log:
Make Log implement o.a.commons.logging.Log.
This is one more small step toward unified logging.
Note that we already depend on c-logging.
Revision Changes Path
1.2 +70 -1 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/log/Log.java
Index: Log.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/log/Log.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Log.java 6 Jan 2002 08:34:56 -0000 1.1
+++ Log.java 12 Jul 2002 17:56:23 -0000 1.2
@@ -100,7 +100,7 @@
* @author Alex Chaffee [alex@jguru.com]
* @author Costin Manolache
**/
-public class Log {
+public class Log implements org.apache.commons.logging.Log {
/**
* Verbosity level codes.
@@ -253,6 +253,75 @@
proxy=l;
}
+
+ // -------------------- Common-logging impl --------------------
+
+
+ // -------------------- Log implementation --------------------
+
+ public void debug(Object message) {
+ log(message.toString(), null, DEBUG);
+ }
+
+ public void debug(Object message, Throwable exception) {
+ log(message.toString(), exception, DEBUG);
+ }
+
+ public void error(Object message) {
+ log(message.toString(), null, ERROR);
+ }
+
+ public void error(Object message, Throwable exception) {
+ log(message.toString(), exception, ERROR);
+ }
+
+ public void fatal(Object message) {
+ log(message.toString(), null, FATAL);
+ }
+
+ public void fatal(Object message, Throwable exception) {
+ log(message.toString(), exception, FATAL);
+ }
+
+ public void info(Object message) {
+ log(message.toString(), null, INFORMATION);
+ }
+
+ public void info(Object message, Throwable exception) {
+ log(message.toString(), exception, INFORMATION);
+ }
+ public void trace(Object message) {
+ log(message.toString(), null, DEBUG);
+ }
+ public void trace(Object message, Throwable exception) {
+ log(message.toString(), exception, DEBUG);
+ }
+ public void warn(Object message) {
+ log(message.toString(), null, WARNING);
+ }
+ public void warn(Object message, Throwable exception) {
+ log(message.toString(), exception, WARNING);
+ }
+
+ public boolean isDebugEnabled() {
+ return proxy.getLevel() <= DEBUG;
+ }
+ public boolean isErrorEnabled() {
+ return proxy.getLevel() <= ERROR;
+ }
+ public boolean isFatalEnabled() {
+ return proxy.getLevel() <= FATAL;
+ }
+ public boolean isInfoEnabled() {
+ return proxy.getLevel() <= INFORMATION;
+ }
+ public boolean isTraceEnabled() {
+ return proxy.getLevel() <= DEBUG;
+ }
+ public boolean isWarnEnabled() {
+ return proxy.getLevel() <= WARNING;
+ }
+
/** Security notes:
Log acts as a facade to an actual logger ( which has setters, etc).
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>