1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 }