View Javadoc

1   /*
2    *  Copyright 1999-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.struts.flow;
17  
18  import org.apache.commons.logging.*;
19  
20  /***  Logger extension that hooks into commons-logging */
21  public class CommonsLogger extends org.apache.struts.flow.core.Logger {
22  
23      private final static Log log = LogFactory.getLog(CommonsLogger.class);
24  
25  
26      /***
27       *  Logs an error message
28       *
29       *@param  msg  The message
30       */
31      public void error(String msg) {
32          log.error(msg);
33      }
34  
35  
36      /***
37       *  Logs a warning message
38       *
39       *@param  msg  The message
40       */
41      public void warn(String msg) {
42          log.warn(msg);
43      }
44  
45  
46      /***
47       *  Logs an info message
48       *
49       *@param  msg  The message
50       */
51      public void info(String msg) {
52          log.info(msg);
53      }
54  
55  
56      /***
57       *  Logs a debug message
58       *
59       *@param  msg  The message
60       */
61      public void debug(String msg) {
62          log.debug(msg);
63      }
64  
65  
66      /***
67       *  Gets whether debugging is enabled
68       *
69       *@return    True if enabled
70       */
71      public boolean isDebugEnabled() {
72          return log.isDebugEnabled();
73      }
74  
75  
76      /***
77       *  Prints an exception
78       *
79       *@param  e  The exception
80       */
81      public void error(Exception e) {
82          log.error(e);
83      }
84  }