Author: reinhard
Date: Wed Oct 13 23:35:23 2004
New Revision: 54772

Added:
   
cocoon/whiteboard/block-deployer/src/api/org/apache/cocoon/blockdeployer/logging/
   
cocoon/whiteboard/block-deployer/src/api/org/apache/cocoon/blockdeployer/logging/LoggerFacade.java
   
cocoon/whiteboard/block-deployer/test/junit/org/apache/cocoon/blockdeployer/logging/
   
cocoon/whiteboard/block-deployer/test/junit/org/apache/cocoon/blockdeployer/logging/ConsoleLogger.java
Log:
- Integrate Logging facade that enables plugging-in any logging framework from
clients using this library

- commons transaction logging facade impl that redirects the logging messages 
into 
cocoon block deployer logging facade

- some javadocs

- tweaking some unit tests

Added: 
cocoon/whiteboard/block-deployer/src/api/org/apache/cocoon/blockdeployer/logging/LoggerFacade.java
==============================================================================
--- (empty file)
+++ 
cocoon/whiteboard/block-deployer/src/api/org/apache/cocoon/blockdeployer/logging/LoggerFacade.java
  Wed Oct 13 23:35:23 2004
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.cocoon.blockdeployer.logging;
+
+/**
+ * Logger facade that enables using any logging framework at clients using
+ * this API
+ * 
+ * @since 0.1
+ */
+public interface LoggerFacade {
+       
+       public void debug(String msg);
+    public void debug(Class clazz, String msg);
+       public boolean isDebugEnabled();
+       public void info(String msg);
+    public void info(Class clazz, String msg);
+       public boolean isInfoEnabled();
+       public void warn(String msg);
+    public void warn(Class clazz, String msg);
+       public boolean isWarnEnabled();
+       public void error(String error);
+    public void error(Class clazz, String msg);
+       public boolean isErrorEnabled();
+       
+}

Added: 
cocoon/whiteboard/block-deployer/test/junit/org/apache/cocoon/blockdeployer/logging/ConsoleLogger.java
==============================================================================
--- (empty file)
+++ 
cocoon/whiteboard/block-deployer/test/junit/org/apache/cocoon/blockdeployer/logging/ConsoleLogger.java
      Wed Oct 13 23:35:23 2004
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.cocoon.blockdeployer.logging;
+
+/**
+ * @since 0.1
+ */
+public class ConsoleLogger implements LoggerFacade {
+
+       public void debug(String msg) {
+               System.out.println(" DEBUG: " + msg);
+       }
+    
+    public void debug(Class clazz, String msg) {
+       this.debug(clazz.getName() + ": " + msg);
+    }
+
+       public boolean isDebugEnabled() {
+               return true;
+       }
+
+       public void info(String msg) {
+               System.out.println("  INFO: " + msg);
+       }
+
+    public void info(Class clazz, String msg) {
+        this.info(clazz.getName() + ": " + msg);
+    }    
+    
+       public boolean isInfoEnabled() {
+               return true;
+       }
+
+       public void warn(String msg) {
+               System.out.println("  WARN: " + msg);
+       }
+
+    public void warn(Class clazz, String msg) {
+        this.warn(clazz.getName() + ": " + msg);
+    }
+    
+       public boolean isWarnEnabled() {
+               return true;
+       }
+
+       public void error(String msg) {
+               System.out.println(" ERROR: " + msg);
+       }
+
+    public void error(Class clazz, String msg) {
+        this.error(clazz.getName() + ": " + msg);
+    }
+    
+       public boolean isErrorEnabled() {
+               return true;
+       }
+
+}

Reply via email to