KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > portal > pluto > service > log > LoggerImpl


1 /*
2  * Copyright 2004,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.portal.pluto.service.log;
17
18 import org.apache.avalon.framework.logger.Logger;
19
20 /**
21  * Our own log service logging to an avalon logger
22  *
23  * @author <a HREF="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
24  *
25  * @version CVS $Id: LoggerImpl.java 30932 2004-07-29 17:35:38Z vgritsenko $
26  */

27 public class LoggerImpl
28 implements org.apache.pluto.services.log.Logger {
29
30     /** The logger to use */
31     protected Logger logger;
32     
33     /** Constructor */
34     public LoggerImpl(Logger logger) {
35         this.logger = logger;
36     }
37
38     /* (non-Javadoc)
39      * @see org.apache.pluto.services.log.LogService#debug(java.lang.String, java.lang.String, java.lang.Throwable)
40      */

41     public void debug(String JavaDoc aMessage, Throwable JavaDoc aThrowable) {
42         this.logger.debug(aMessage, aThrowable);
43     }
44
45     /* (non-Javadoc)
46      * @see org.apache.pluto.services.log.LogService#debug(java.lang.String, java.lang.String)
47      */

48     public void debug(String JavaDoc aMessage) {
49         this.logger.debug(aMessage);
50     }
51
52     /* (non-Javadoc)
53      * @see org.apache.pluto.services.log.LogService#error(java.lang.String, java.lang.String, java.lang.Throwable)
54      */

55     public void error(String JavaDoc aMessage, Throwable JavaDoc aThrowable) {
56         this.logger.error(aMessage, aThrowable);
57     }
58
59     /* (non-Javadoc)
60      * @see org.apache.pluto.services.log.LogService#info(java.lang.String, java.lang.String)
61      */

62     public void info(String JavaDoc aMessage) {
63         this.logger.info(aMessage);
64     }
65
66     /* (non-Javadoc)
67      * @see org.apache.pluto.services.log.LogService#isDebugEnabled(java.lang.String)
68      */

69     public boolean isDebugEnabled() {
70         return this.logger.isDebugEnabled();
71     }
72
73     /* (non-Javadoc)
74      * @see org.apache.pluto.services.log.LogService#isErrorEnabled(java.lang.String)
75      */

76     public boolean isErrorEnabled() {
77         return this.logger.isErrorEnabled();
78     }
79
80     /* (non-Javadoc)
81      * @see org.apache.pluto.services.log.LogService#isInfoEnabled(java.lang.String)
82      */

83     public boolean isInfoEnabled() {
84         return this.logger.isInfoEnabled();
85     }
86
87     /* (non-Javadoc)
88      * @see org.apache.pluto.services.log.LogService#isWarnEnabled(java.lang.String)
89      */

90     public boolean isWarnEnabled() {
91         return this.logger.isWarnEnabled();
92     }
93
94     /* (non-Javadoc)
95      * @see org.apache.pluto.services.log.LogService#warn(java.lang.String, java.lang.String)
96      */

97     public void warn(String JavaDoc aMessage) {
98         this.logger.warn(aMessage);
99     }
100
101     /* (non-Javadoc)
102      * @see org.apache.pluto.services.log.Logger#error(java.lang.Throwable)
103      */

104     public void error(Throwable JavaDoc throwable) {
105         this.logger.error("Exception", throwable);
106     }
107     
108     /* (non-Javadoc)
109      * @see org.apache.pluto.services.log.Logger#error(java.lang.String)
110      */

111     public void error(String JavaDoc aMessage) {
112         this.logger.error(aMessage);
113     }
114 }
115
Popular Tags