KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > log > JLog


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: JLog.java 572 2006-06-04 21:23:27Z benoitf $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.easybeans.log;
27
28 import java.io.Serializable JavaDoc;
29
30 import org.objectweb.easybeans.i18n.I18n;
31
32 /**
33  * Interface used for the logging.<br>
34  * This don't use directly commons logging as the aim of this logging is to
35  * provide internationalization abilities and to allow to use MessageFormat
36  * message with an array of objects.
37  * @author Florent Benoit
38  */

39
40 public interface JLog extends Serializable JavaDoc {
41
42     /**
43      * <p>
44      * Is debug logging currently enabled?
45      * </p>
46      * <p>
47      * Call this method to prevent having to perform expensive operations (for
48      * example, <code>String</code> concatenation) when the log level is more
49      * than debug.
50      * </p>
51      * @return true if it is enabled, else false
52      */

53     boolean isDebugEnabled();
54
55     /**
56      * <p>
57      * Is error logging currently enabled?
58      * </p>
59      * <p>
60      * Call this method to prevent having to perform expensive operations (for
61      * example, <code>String</code> concatenation) when the log level is more
62      * than error.
63      * </p>
64      * @return true if it is enabled, else false
65      */

66     boolean isErrorEnabled();
67
68     /**
69      * <p>
70      * Is fatal logging currently enabled?
71      * </p>
72      * <p>
73      * Call this method to prevent having to perform expensive operations (for
74      * example, <code>String</code> concatenation) when the log level is more
75      * than fatal.
76      * </p>
77      * @return true if it is enabled, else false
78      */

79     boolean isFatalEnabled();
80
81     /**
82      * <p>
83      * Is info logging currently enabled?
84      * </p>
85      * <p>
86      * Call this method to prevent having to perform expensive operations (for
87      * example, <code>String</code> concatenation) when the log level is more
88      * than info.
89      * </p>
90      * @return true if it is enabled, else false
91      */

92     boolean isInfoEnabled();
93
94     /**
95      * <p>
96      * Is trace logging currently enabled?
97      * </p>
98      * <p>
99      * Call this method to prevent having to perform expensive operations (for
100      * example, <code>String</code> concatenation) when the log level is more
101      * than trace.
102      * </p>
103      * @return true if it is enabled, else false
104      */

105     boolean isTraceEnabled();
106
107     /**
108      * <p>
109      * Is warn logging currently enabled?
110      * </p>
111      * <p>
112      * Call this method to prevent having to perform expensive operations (for
113      * example, <code>String</code> concatenation) when the log level is more
114      * than warn.
115      * </p>
116      * @return true if it is enabled, else false
117      */

118     boolean isWarnEnabled();
119
120     /**
121      * <p>
122      * Log a message with trace log level.
123      * </p>
124      * @param message - This could be
125      * <ul>
126      * <li>an entry of an I18n repository</li>
127      * <li>a preformated message given to MessageFormat class</li>
128      * <li>or a simple object on which toString() method will be called</li>
129      * </ul>
130      * @param args could be empty or contains the object for the formatter (I18n
131      * case). To log an exception, the exception must be the last
132      * argument.
133      */

134     void trace(final Object JavaDoc message, final Object JavaDoc... args);
135
136     /**
137      * <p>
138      * Log a message with debug log level.
139      * </p>
140      * @param message - This could be
141      * <ul>
142      * <li>an entry of an I18n repository</li>
143      * <li>a preformated message given to MessageFormat class</li>
144      * <li>or a simple object on which toString() method will be called</li>
145      * </ul>
146      * @param args could be empty or contains the object for the formatter (I18n
147      * case). To log an exception, the exception must be the last
148      * argument.
149      */

150     void debug(final Object JavaDoc message, final Object JavaDoc... args);
151
152     /**
153      * <p>
154      * Log a message with info log level.
155      * </p>
156      * @param message - This could be
157      * <ul>
158      * <li>an entry of an I18n repository</li>
159      * <li>a preformated message given to MessageFormat class</li>
160      * <li>or a simple object on which toString() method will be called</li>
161      * </ul>
162      * @param args could be empty or contains the object for the formatter (I18n
163      * case). To log an exception, the exception must be the last
164      * argument.
165      */

166     void info(final Object JavaDoc message, final Object JavaDoc... args);
167
168     /**
169      * <p>
170      * Log a message with warn log level.
171      * </p>
172      * @param message - This could be
173      * <ul>
174      * <li>an entry of an I18n repository</li>
175      * <li>a preformated message given to MessageFormat class</li>
176      * <li>or a simple object on which toString() method will be called</li>
177      * </ul>
178      * @param args could be empty or contains the object for the formatter (I18n
179      * case). To log an exception, the exception must be the last
180      * argument.
181      */

182     void warn(final Object JavaDoc message, final Object JavaDoc... args);
183
184     /**
185      * <p>
186      * Log a message with error log level.
187      * </p>
188      * @param message - This could be
189      * <ul>
190      * <li>an entry of an I18n repository</li>
191      * <li>a preformated message given to MessageFormat class</li>
192      * <li>or a simple object on which toString() method will be called</li>
193      * </ul>
194      * @param args could be empty or contains the object for the formatter (I18n
195      * case). To log an exception, the exception must be the last
196      * argument.
197      */

198     void error(final Object JavaDoc message, final Object JavaDoc... args);
199
200     /**
201      * <p>
202      * Log a message with fatal log level.
203      * </p>
204      * @param message - This could be
205      * <ul>
206      * <li>an entry of an I18n repository</li>
207      * <li>a preformated message given to MessageFormat class</li>
208      * <li>or a simple object on which toString() method will be called</li>
209      * </ul>
210      * @param args could be empty or contains the object for the formatter (I18n
211      * case). To log an exception, the exception must be the last
212      * argument.
213      */

214     void fatal(final Object JavaDoc message, final Object JavaDoc... args);
215
216
217     /**
218      * Gets the i18n object associated to this logger.
219      * @return i18n object.
220      */

221     I18n getI18n();
222
223 }
224
Popular Tags