KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > directwebremoting > util > LoggingOutput


1 /*
2  * Copyright 2005 Joe Walker
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.directwebremoting.util;
17
18 /**
19  * We don't want to force users to use commons-logging, but there are no
20  * logging APIs available at 1.3 so this lets us use Servlet.log if
21  * commons-logging is not available.
22  * @author Joe Walker [joe at getahead dot ltd dot uk]
23  */

24 public interface LoggingOutput
25 {
26     /**
27      * Something has gone very badly wrong.
28      * Processing is likely to stop.
29      */

30     public static final int LEVEL_FATAL = 5;
31
32     /**
33      * Something has gone wrong with the current request.
34      * The user will notice that we've broken something.
35      */

36     public static final int LEVEL_ERROR = 4;
37
38     /**
39      * Something has gone wrong, but it could well be the users fault.
40      * No need to panic yet.
41      */

42     public static final int LEVEL_WARN = 3;
43
44     /**
45      * An event happened that we might need to keep track of.
46      */

47     public static final int LEVEL_INFO = 2;
48
49     /**
50      * Testing information.
51      */

52     public static final int LEVEL_DEBUG = 1;
53
54     /**
55      * Logger a debug message
56      * @param message The text to log
57      */

58     public void debug(String JavaDoc message);
59
60     /**
61      * Logger an info message
62      * @param message The text to log
63      */

64     public void info(String JavaDoc message);
65
66     /**
67      * Logger a warning message
68      * @param message The text to log
69      */

70     public void warn(String JavaDoc message);
71
72     /**
73      * Logger a warning message
74      * @param message The text to log
75      * @param th An optional stack trace
76      */

77     public void warn(String JavaDoc message, Throwable JavaDoc th);
78
79     /**
80      * Logger an error message
81      * @param message The text to log
82      */

83     public void error(String JavaDoc message);
84
85     /**
86      * Logger an error message
87      * @param message The text to log
88      * @param th An optional stack trace
89      */

90     public void error(String JavaDoc message, Throwable JavaDoc th);
91
92     /**
93      * Logger a fatal error message
94      * @param message The text to log
95      */

96     public void fatal(String JavaDoc message);
97
98     /**
99      * Logger a fatal error message
100      * @param message The text to log
101      * @param th An optional stack trace
102      */

103     public void fatal(String JavaDoc message, Throwable JavaDoc th);
104
105     /**
106      * Save CPU time when we are not debugging
107      * @return true if debugging is enabled
108      */

109     public boolean isDebugEnabled();
110 }
111
Popular Tags