1 package org.apache.turbine.services.logging;
2
3 /* ====================================================================
4 * The Apache Software License, Version 1.1
5 *
6 * Copyright (c) 2001 The Apache Software Foundation. All rights
7 * reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in
18 * the documentation and/or other materials provided with the
19 * distribution.
20 *
21 * 3. The end-user documentation included with the redistribution,
22 * if any, must include the following acknowledgment:
23 * "This product includes software developed by the
24 * Apache Software Foundation (http://www.apache.org/)."
25 * Alternately, this acknowledgment may appear in the software itself,
26 * if and wherever such third-party acknowledgments normally appear.
27 *
28 * 4. The names "Apache" and "Apache Software Foundation" and
29 * "Apache Turbine" must not be used to endorse or promote products
30 * derived from this software without prior written permission. For
31 * written permission, please contact apache@apache.org.
32 *
33 * 5. Products derived from this software may not be called "Apache",
34 * "Apache Turbine", nor may "Apache" appear in their name, without
35 * prior written permission of the Apache Software Foundation.
36 *
37 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
38 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
39 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
41 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
43 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
44 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
45 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
46 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
47 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48 * SUCH DAMAGE.
49 * ====================================================================
50 *
51 * This software consists of voluntary contributions made by many
52 * individuals on behalf of the Apache Software Foundation. For more
53 * information on the Apache Software Foundation, please see
54 * <http://www.apache.org/>.
55 */
56
57 import org.apache.turbine.services.TurbineServices;
58 import org.apache.turbine.util.RunData;
59
60 /***
61 * This is a facade class for {@link TurbineLoggingService}.
62 *
63 * @author <a href="mailto:Tomasz.Zielinski@e-point.pl">Tomasz Zielinski</a>
64 * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
65 * @version $Id: TurbineLogging.java,v 1.1.1.1 2001/08/16 05:09:05 jvanzyl Exp $
66 */
67 public class TurbineLogging
68 {
69 /***
70 * Utility method for accessing the service
71 * implementation
72 *
73 * @return a LoggingService implementation instance
74 */
75 protected static LoggingService getService()
76 {
77 return (LoggingService)TurbineServices
78 .getInstance().getService(LoggingService.SERVICE_NAME);
79 }
80
81 /***
82 * Attempt to close the log files when the class is GC'd.
83 */
84 protected void finalize() throws Throwable
85 {
86 getService().shutdown();
87 }
88
89 /***
90 * This metod returns default logger for Turbine System
91 *
92 * @return The default logger for system.
93 */
94 public static Logger getLogger()
95 {
96 return getService().getLogger();
97 }
98
99 /***
100 * This metod returns logger with given name.
101 */
102 public static Logger getLogger(String logName)
103 {
104 return getService().getLogger(logName);
105 }
106
107 /***
108 * This metod sets the log level in default logger
109 */
110 public static void setLogLevel(int level)
111 {
112 getService().setLogLevel(level);
113 }
114
115 /***
116 * This metod sets the log level in the logger of given name
117 */
118 public static void setLogLevel(String logName,int level)
119 {
120 getService().setLogLevel(logName,level);
121 }
122
123 /***
124 * This metod sets format style of the default logger
125 */
126 public static void setFormat(String format)
127 {
128 getService().setFormat(format);
129 }
130
131 /***
132 * This metod sets format style of the given logger.
133 */
134 public static void setFormat(String logName, String format)
135 {
136 getService().setFormat(logName,format);
137 }
138
139 /***
140 * This is a log metod with logLevel == DEBUG, printing is done by
141 * the default logger
142 */
143 public static void debug(String message)
144 {
145 getService().debug(message);
146 }
147
148 /***
149 * This is a log metod with logLevel == DEBUG, printing is done by
150 * the default logger
151 */
152 public static void debug(String message, Throwable t)
153 {
154 getService().debug(message, t);
155 }
156
157 /***
158 * This is a log metod with logLevel == DEBUG, printing is done by
159 * the given logger
160 */
161 public static void debug(String logName, String message, Throwable t)
162 {
163 getService().debug(logName, message, t);
164 }
165
166 /***
167 * This is a log metod with logLevel == DEBUG, printing is done by
168 * the given logger
169 */
170 public static void debug(String logName, String message)
171 {
172 getService().debug(logName, message);
173 }
174
175 /***
176 * This is a log metod with logLevel == DEBUG, printing is done by
177 * the default logger
178 */
179 public static void debug(String message, RunData data)
180 {
181 getService().debug(message, data);
182 }
183
184 /***
185 * This is a log metod with logLevel == DEBUG, printing is done by
186 * the default logger
187 */
188 public static void debug(String message, RunData data, Throwable t)
189 {
190 getService().debug(message, data, t);
191 }
192
193 /***
194 * This is a log metod with logLevel == DEBUG, printing is done by
195 * the given logger
196 */
197 public static void debug(String logName, String message, RunData data, Throwable t)
198 {
199 getService().debug(logName, message, data, t);
200 }
201
202 /***
203 * This is a log metod with logLevel == DEBUG, printing is done by
204 * the given logger
205 */
206 public static void debug(String logName, String message, RunData data)
207 {
208 getService().debug(logName, message, data);
209 }
210
211 /***
212 * This is a log metod with logLevel == INFO, printing is done by
213 * the default logger
214 */
215 public static void info(String message)
216 {
217 getService().info(message);
218 }
219
220 /***
221 * This is a log metod with logLevel == INFO, printing is done by
222 * the default logger
223 */
224 public static void info(String message, Throwable t)
225 {
226 getService().info(message, t);
227 }
228
229 /***
230 * This is a log metod with logLevel == INFO, printing is done by
231 * the given logger
232 */
233 public static void info(String logName, String message)
234 {
235 getService().info(logName, message);
236 }
237
238 /***
239 * This is a log metod with logLevel == INFO, printing is done by
240 * the given logger
241 */
242 public static void info(String logName, String message, Throwable t)
243 {
244 getService().info(logName, message, t);
245 }
246
247 /***
248 * This is a log metod with logLevel == INFO, printing is done by
249 * the default logger
250 */
251 public static void info(String message, RunData data)
252 {
253 getService().info(message, data);
254 }
255
256 /***
257 * This is a log metod with logLevel == INFO, printing is done by
258 * the default logger
259 */
260 public static void info(String message, RunData data, Throwable t)
261 {
262 getService().info(message, data, t);
263 }
264
265 /***
266 * This is a log metod with logLevel == INFO, printing is done by
267 * the given logger
268 */
269 public static void info(String logName, String message, RunData data)
270 {
271 getService().info(logName, message, data);
272 }
273
274 /***
275 * This is a log metod with logLevel == INFO, printing is done by
276 * the given logger
277 */
278 public static void info(String logName, String message, RunData data, Throwable t)
279 {
280 getService().info(logName, message, data, t);
281 }
282
283 /***
284 * This is a log metod with logLevel == WARN, printing is done by
285 * the default logger
286 */
287 public static void warn(String message)
288 {
289 getService().warn(message);
290 }
291
292 /***
293 * This is a log metod with logLevel == WARN, printing is done by
294 * the default logger
295 */
296 public static void warn(String message, Throwable t)
297 {
298 getService().warn(message, t);
299 }
300
301 /***
302 * This is a log metod with logLevel == WARN, printing is done by
303 * the given logger
304 */
305 public static void warn(String logName, String message)
306 {
307 getService().warn(logName, message);
308 }
309
310 /***
311 * This is a log metod with logLevel == WARN, printing is done by
312 * the given logger
313 */
314 public static void warn(String logName, String message, Throwable t)
315 {
316 getService().warn(logName, message, t);
317 }
318
319 /***
320 * This is a log metod with logLevel == WARN, printing is done by
321 * the default logger
322 */
323 public static void warn(String message, RunData data)
324 {
325 getService().warn(message, data);
326 }
327
328 /***
329 * This is a log metod with logLevel == WARN, printing is done by
330 * the default logger
331 */
332 public static void warn(String message, RunData data, Throwable t)
333 {
334 getService().warn(message, data, t);
335 }
336
337 /***
338 * This is a log metod with logLevel == WARN, printing is done by
339 * the given logger
340 */
341 public static void warn(String logName, String message, RunData data)
342 {
343 getService().warn(logName, message, data);
344 }
345
346 /***
347 * This is a log metod with logLevel == WARN, printing is done by
348 * the given logger
349 */
350 public static void warn(String logName, String message, RunData data, Throwable t)
351 {
352 getService().warn(logName, message, data, t);
353 }
354
355 /***
356 * This is a log metod with logLevel == ERROR, printing is done by
357 * the default logger
358 */
359 public static void error(String message)
360 {
361 getService().error(message);
362 }
363
364 /***
365 * This is a log metod with logLevel == ERROR, printing is done by
366 * the default logger
367 */
368 public static void error(String message, Throwable t)
369 {
370 getService().error(message, t);
371 }
372
373 /***
374 * This is a log metod with logLevel == ERROR, printing is done by
375 * the given logger
376 */
377 public static void error(String logName, String message)
378 {
379 getService().error(logName, message);
380 }
381
382 /***
383 * This is a log metod with logLevel == ERROR, printing is done by
384 * the given logger
385 */
386 public static void error(String logName, String message, Throwable t)
387 {
388 getService().error(logName, message, t);
389 }
390
391 /***
392 * This is a log metod with logLevel == ERROR, printing is done by
393 * the default logger
394 */
395 public static void error(String message, RunData data)
396 {
397 getService().error(message, data);
398 }
399
400 /***
401 * This is a log metod with logLevel == ERROR, printing is done by
402 * the default logger
403 */
404 public static void error(String message, RunData data, Throwable t)
405 {
406 getService().error(message, data, t);
407 }
408
409 /***
410 * This is a log metod with logLevel == ERROR, printing is done by
411 * the given logger
412 */
413 public static void error(String logName, String message, RunData data)
414 {
415 getService().error(logName, message, data);
416 }
417
418 /***
419 * This is a log metod with logLevel == ERROR, printing is done by
420 * the given logger
421 */
422 public static void error(String logName, String message, RunData data, Throwable t)
423 {
424 getService().error(logName, message, data, t);
425 }
426 }
This page was automatically generated by Maven