From 79f6d89da8359e1a6ba769b5abe3d768e274a366 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Tue, 27 Apr 2010 11:11:19 +0000 Subject: [PATCH] Fixes 310605 (Make a clean room implementation of the JSP logger bridge). git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1571 7e9141cc-0065-0410-87d8-b60c137991c4 --- VERSION.txt | 1 + .../java/org/eclipse/jetty/jsp/JettyLog.java | 102 ++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 jetty-jsp-2.1/src/main/java/org/eclipse/jetty/jsp/JettyLog.java diff --git a/VERSION.txt b/VERSION.txt index 59ad11ed22f..7aba2484202 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -22,6 +22,7 @@ jetty-7.1.0-SNAPSHOT + Add AnnotationConfiguration to jetty-plus.xml + 310467 Allow SocketConnector to create generic Connection objects + 310603 Make Logger interface consistent + + 310605 Make a clean room implementation of the JSP logger bridge jetty-7.0.2.v20100331 31 March 2010 + 297552 Don't call Continuation timeouts from acceptor tick diff --git a/jetty-jsp-2.1/src/main/java/org/eclipse/jetty/jsp/JettyLog.java b/jetty-jsp-2.1/src/main/java/org/eclipse/jetty/jsp/JettyLog.java new file mode 100644 index 00000000000..e8bd4afe952 --- /dev/null +++ b/jetty-jsp-2.1/src/main/java/org/eclipse/jetty/jsp/JettyLog.java @@ -0,0 +1,102 @@ +package org.eclipse.jetty.jsp; + +import com.sun.org.apache.commons.logging.LogFactory; +import org.eclipse.jetty.util.log.Log; +import org.eclipse.jetty.util.log.Logger; + +/** + * @version $Revision$ $Date$ + */ +public class JettyLog implements com.sun.org.apache.commons.logging.Log +{ + private static volatile boolean __initialized; + + /** + * Called via reflection from WebXmlProcessor + */ + public static synchronized void init() + { + if (!__initialized) + { + __initialized = true; + LogFactory.setLogImplClassName(JettyLog.class.getName()); + } + } + + private final Logger _logger; + + public JettyLog(String name) + { + _logger = Log.getLogger(name); + } + + public void fatal(Object o) + { + error(o); + } + + public void fatal(Object o, Throwable throwable) + { + error(o, throwable); + } + + public boolean isErrorEnabled() + { + return true; + } + + public void error(Object o) + { + warn(o); + } + + public void error(Object o, Throwable throwable) + { + _logger.warn(String.valueOf(o), throwable); + } + + public boolean isWarnEnabled() + { + return true; + } + + public void warn(Object o) + { + _logger.warn(String.valueOf(o)); + } + + public boolean isInfoEnabled() + { + return true; + } + + public void info(Object o) + { + _logger.info(String.valueOf(o)); + } + + public boolean isDebugEnabled() + { + return _logger.isDebugEnabled(); + } + + public void debug(Object o) + { + _logger.debug(String.valueOf(o)); + } + + public void debug(Object o, Throwable throwable) + { + _logger.debug(String.valueOf(o), throwable); + } + + public boolean isTraceEnabled() + { + return isDebugEnabled(); + } + + public void trace(Object o) + { + debug(o); + } +}