click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From med...@apache.org
Subject svn commit: r780398 - in /incubator/click/trunk/click: .classpath build/build.properties build/build.xml documentation/docs/roadmap-changes.html extras/src/org/apache/click/extras/service/Slf4jLogService.java lib/
Date Sun, 31 May 2009 10:02:28 GMT
Author: medgar
Date: Sun May 31 10:02:28 2009
New Revision: 780398

URL: http://svn.apache.org/viewvc?rev=780398&view=rev
Log:
CLK-555

Added:
    incubator/click/trunk/click/extras/src/org/apache/click/extras/service/Slf4jLogService.java
Modified:
    incubator/click/trunk/click/.classpath
    incubator/click/trunk/click/build/build.properties
    incubator/click/trunk/click/build/build.xml
    incubator/click/trunk/click/documentation/docs/roadmap-changes.html
    incubator/click/trunk/click/lib/   (props changed)

Modified: incubator/click/trunk/click/.classpath
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/.classpath?rev=780398&r1=780397&r2=780398&view=diff
==============================================================================
--- incubator/click/trunk/click/.classpath (original)
+++ incubator/click/trunk/click/.classpath Sun May 31 10:02:28 2009
@@ -32,5 +32,6 @@
 	<classpathentry kind="lib" path="examples/webapp/WEB-INF/lib/geronimo-annotation_1.0_spec-1.1.1.jar"/>
 	<classpathentry kind="lib" path="examples/webapp/WEB-INF/lib/acegi-security-1.0.7.jar"/>
 	<classpathentry kind="lib" path="examples/webapp/WEB-INF/lib/quartz-all-1.6.3.jar"/>
+	<classpathentry kind="lib" path="lib/slf4j-api-1.5.6.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

Modified: incubator/click/trunk/click/build/build.properties
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/build/build.properties?rev=780398&r1=780397&r2=780398&view=diff
==============================================================================
--- incubator/click/trunk/click/build/build.properties (original)
+++ incubator/click/trunk/click/build/build.properties Sun May 31 10:02:28 2009
@@ -65,5 +65,6 @@
 oro.version=2.0.8
 poi.version=3.0-FINAL
 quartz.version=1.6.3
+slf4j.version=1.5.6
 spring-security.version=1.0.7
 standard.version=1.1.2
\ No newline at end of file

Modified: incubator/click/trunk/click/build/build.xml
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/build/build.xml?rev=780398&r1=780397&r2=780398&view=diff
==============================================================================
--- incubator/click/trunk/click/build/build.xml (original)
+++ incubator/click/trunk/click/build/build.xml Sun May 31 10:02:28 2009
@@ -42,6 +42,7 @@
    <property name="jar.log4j" value="log4j-${log4j.version}.jar"/>
    <property name="jar.ognl" value="ognl-${ognl.version}.jar"/>
    <property name="jar.servlet" value="servlet-api-${servlet-api.version}.jar"/>
+   <property name="jar.slf4j" value="slf4j-api-${slf4j.version}.jar"/>
    <property name="jar.spring" value="spring-${spring.version}.jar"/>
    <property name="jar.upload" value="commons-fileupload-${commons-fileupload.version}.jar"/>
    <property name="jar.velocity" value="velocity-${velocity.version}.jar"/>
@@ -136,6 +137,7 @@
       <pathelement location="lib/${jar.hibernate}"/>
       <pathelement location="lib/${jar.log4j}"/>
       <pathelement location="lib/${jar.servlet}"/>
+      <pathelement location="lib/${jar.slf4j}"/>
       <pathelement location="lib/${jar.spring}"/>
       <pathelement location="lib/${jar.freemarker}"/>
       <pathelement location="dist/${click}.jar"/>
@@ -208,6 +210,7 @@
             <exclude name="lib/${jar.junit}"/>
             <exclude name="lib/${jar.ognl}"/>
             <exclude name="lib/${jar.servlet}"/>
+            <exclude name="lib/${jar.slf4j}"/>
             <exclude name="lib/${jar.velocity}"/>
             <exclude name="lib/spring-*.jar"/>
             <exclude name="lib/${jar.upload}"/>
@@ -560,6 +563,7 @@
       <downloadMacro name="${jar.upload}" path="commons-fileupload/commons-fileupload/${commons-fileupload.version}"/>
       <downloadMacro name="${jar.junit}" path="junit/junit/${junit.version}"/>
       <downloadMacro name="${jar.servlet}" path="javax/servlet/servlet-api/${servlet-api.version}"/>
+      <downloadMacro name="${jar.slf4j}" path="org/slf4j/slf4j-api/${slf4j.version}"/>
       <downloadMacro name="${jar.spring}" path="org/springframework/spring/${spring.version}"/>
       <downloadMacro name="${jar.velocity}" path="org/apache/velocity/velocity/${velocity.version}"/>
       <downloadMacro name="${jar.cayenne}" path="org/apache/cayenne/cayenne-server/${cayenne.version}"/>

Modified: incubator/click/trunk/click/documentation/docs/roadmap-changes.html
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/documentation/docs/roadmap-changes.html?rev=780398&r1=780397&r2=780398&view=diff
==============================================================================
--- incubator/click/trunk/click/documentation/docs/roadmap-changes.html (original)
+++ incubator/click/trunk/click/documentation/docs/roadmap-changes.html Sun May 31 10:02:28
2009
@@ -204,6 +204,12 @@
           [<a target='_blank' href="https://issues.apache.org/jira/browse/CLK-539">539</a>].
       </li>
       <li class="change">
+          Added <a href="extras-api/org/apache/click/extras/service/Slf4jLogService.html">Slf4jLogService</a>
+          for supporting multiple application servers. 
+          This issue was raised Oliver Burn
+          [<a target='_blank' href="https://issues.apache.org/jira/browse/CLK-555">555</a>].
+      </li>
+      <li class="change">
           Improved Page redirect to support parameters. See the new Page methods
           <a href="click-api/org/apache/click/Page.html#setRedirect(java.lang.String,
java.util.Map)">setRedirect(String, Map)</a>
           and <a href="click-api/org/apache/click/Page.html#setRedirect(java.lang.Class,
java.util.Map)">setRedirect(Class, Map)</a>

Added: incubator/click/trunk/click/extras/src/org/apache/click/extras/service/Slf4jLogService.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/service/Slf4jLogService.java?rev=780398&view=auto
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/service/Slf4jLogService.java
(added)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/service/Slf4jLogService.java
Sun May 31 10:02:28 2009
@@ -0,0 +1,215 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.click.extras.service;
+
+
+import javax.servlet.ServletContext;
+
+import org.apache.click.service.LogService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Provides a
+ * <a target="_blank" href="http://www.slf4j.org/">SLF4J</a> LogService adapter
+ * class with a logger name of "<tt>Click</tt>".
+ *
+ * <h3>Configuration</h3>
+ * To configure the JDK LoggingService add the following element to your
+ * <tt>click.xml</tt> configuration file.
+ *
+ * <pre class="codeConfig">
+ * &lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
+ * &lt;click-app charset="UTF-8"&gt;
+ *
+ *     &lt;pages package="org.apache.click.examples.page"/&gt;
+ *
+ *     &lt;<span class="red">log-service</span> classname="<span class="blue">org.apache.click.extras.service.Slf4jLogService</span>"/&gt;
+ *
+ * &lt;/click-app&gt; </pre>
+ *
+ * @author Malcolm Edgar
+ */
+public class Slf4jLogService implements LogService {
+
+    /** The wrapped JDK logger instance. */
+    protected Logger logger;
+
+    /** The logger category name. The default value is "<tt>Click</tt>". */
+    protected String name = "Click";
+
+    /**
+     * @see LogService#onInit(javax.servlet.ServletContext)
+     *
+     * @param servletContext the application servlet context
+     * @throws Exception if an error occurs initializing the LogService
+     */
+    public void onInit(ServletContext servletContext) throws Exception {
+        logger = LoggerFactory.getLogger(getName());
+    }
+
+    /**
+     * @see LogService#onDestroy()
+     */
+    public void onDestroy() {
+    }
+
+    /**
+     * @see LogService#debug(Object)
+     *
+     * @param message the message to log
+     */
+    public void debug(Object message) {
+        logger.debug(String.valueOf(message));
+    }
+
+    /**
+     * @see LogService#debug(Object, Throwable)
+     *
+     * @param message the message to log
+     * @param error the error to log
+     */
+    public void debug(Object message, Throwable error) {
+        logger.debug(String.valueOf(message), error);
+    }
+
+    /**
+     * @see LogService#error(Object)
+     *
+     * @param message the message to log
+     */
+    public void error(Object message) {
+        logger.error(String.valueOf(message));
+    }
+
+    /**
+     * @see LogService#error(Object, Throwable)
+     *
+     * @param message the message to log
+     * @param error the error to log
+     */
+    public void error(Object message, Throwable error) {
+        logger.error(String.valueOf(message), error);
+    }
+
+    /**
+     * @see LogService#info(Object)
+     *
+     * @param message the message to log
+     */
+    public void info(Object message) {
+        logger.info(String.valueOf(message));
+    }
+
+    /**
+     * @see LogService#info(Object, Throwable)
+     *
+     * @param message the message to log
+     * @param error the error to log
+     */
+    public void info(Object message, Throwable error) {
+        logger.info(String.valueOf(message), error);
+    }
+
+    /**
+     * @see LogService#isDebugEnabled()
+     *
+     * @return true if [debug] level logging is enabled
+     */
+    public boolean isDebugEnabled() {
+        return logger.isDebugEnabled();
+    }
+
+    /**
+     * @see LogService#isInfoEnabled()
+     *
+     * @return true if [info] level logging is enabled
+     */
+    public boolean isInfoEnabled() {
+        return logger.isInfoEnabled();
+    }
+
+    /**
+     * @see LogService#isTraceEnabled()
+     *
+     * @return true if [trace] level logging is enabled
+     */
+    public boolean isTraceEnabled() {
+        return logger.isTraceEnabled();
+    }
+
+    /**
+     * @see LogService#trace(Object)
+     *
+     * @param message the message to log
+     */
+    public void trace(Object message) {
+        logger.trace(String.valueOf(message));
+    }
+
+    /**
+     * @see LogService#trace(Object, Throwable)
+     *
+     * @param message the message to log
+     * @param error the error to log
+     */
+    public void trace(Object message, Throwable error) {
+        logger.trace(String.valueOf(message), error);
+    }
+
+    /**
+     * @see LogService#warn(Object)
+     *
+     * @param message the message to log
+     */
+    public void warn(Object message) {
+        logger.warn(String.valueOf(message));
+    }
+
+    /**
+     * @see LogService#warn(Object, Throwable)
+     *
+     * @param message the message to log
+     * @param error the error to log
+     */
+    public void warn(Object message, Throwable error) {
+        logger.warn(String.valueOf(message), error);
+    }
+
+    /**
+     * Return the logger category name.
+     *
+     * @return the logger category name
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * The logger category name. Setting the name after the <tt>onInit()</tt>
+     * method has bee invoked will have no effect on the Log4J loggers name.
+     *
+     * @param name the logger category name to set
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+
+}

Propchange: incubator/click/trunk/click/lib/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sun May 31 10:02:28 2009
@@ -24,3 +24,4 @@
 log4j-1.2.14.jar
 hibernate-3.2.6.ga.jar
 velocity-1.6.2.jar
+slf4j-api-1.5.6.jar



Mime
View raw message