001: /*
002: * Copyright (c) 2004-2008 QOS.ch
003: * All rights reserved.
004: *
005: * Permission is hereby granted, free of charge, to any person obtaining
006: * a copy of this software and associated documentation files (the
007: * "Software"), to deal in the Software without restriction, including
008: * without limitation the rights to use, copy, modify, merge, publish,
009: * distribute, sublicense, and/or sell copies of the Software, and to
010: * permit persons to whom the Software is furnished to do so, subject to
011: * the following conditions:
012: *
013: * The above copyright notice and this permission notice shall be
014: * included in all copies or substantial portions of the Software.
015: *
016: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
017: * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
018: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
019: * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
020: * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
021: * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
022: * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
023: */
024:
025: package org.slf4j;
026:
027: /**
028: *
029: * The main user interface to logging. It is expected that logging
030: * takes place through concrete implementations of this interface.
031: *
032: * @author Ceki Gülcü
033: */
034: public interface Logger {
035:
036: /**
037: * Case insensitive String constant used to retrieve the name of the root logger.
038: * @since 1.3
039: */
040: final public String ROOT_LOGGER_NAME = "ROOT";
041:
042: /**
043: * Return the name of this <code>Logger</code> instance.
044: */
045: public String getName();
046:
047: /**
048: * Is the logger instance enabled for the TRACE level?
049: * @return True if this Logger is enabled for the TRACE level,
050: * false otherwise.
051: *
052: * @since 1.4
053: */
054: public boolean isTraceEnabled();
055:
056: /**
057: * Log a message at the TRACE level.
058: *
059: * @param msg the message string to be logged
060: * @since 1.4
061: */
062: public void trace(String msg);
063:
064: /**
065: * Log a message at the TRACE level according to the specified format
066: * and argument.
067: *
068: * <p>This form avoids superfluous object creation when the logger
069: * is disabled for the TRACE level. </p>
070: *
071: * @param format the format string
072: * @param arg the argument
073: *
074: * @since 1.4
075: */
076: public void trace(String format, Object arg);
077:
078: /**
079: * Log a message at the TRACE level according to the specified format
080: * and arguments.
081: *
082: * <p>This form avoids superfluous object creation when the logger
083: * is disabled for the TRACE level. </p>
084: *
085: * @param format the format string
086: * @param arg1 the first argument
087: * @param arg2 the second argument
088: *
089: * @since 1.4
090: */
091: public void trace(String format, Object arg1, Object arg2);
092:
093: /**
094: * Log a message at the TRACE level according to the specified format
095: * and arguments.
096: *
097: * <p>This form avoids superfluous object creation when the logger
098: * is disabled for the TRACE level. </p>
099: *
100: * @param format the format string
101: * @param argArray an array of arguments
102: *
103: * @since 1.4
104: */
105: public void trace(String format, Object[] argArray);
106:
107: /**
108: * Log an exception (throwable) at the TRACE level with an
109: * accompanying message.
110: *
111: * @param msg the message accompanying the exception
112: * @param t the exception (throwable) to log
113: *
114: * @since 1.4
115: */
116: public void trace(String msg, Throwable t);
117:
118: /**
119: * Similar to {@link #isTraceEnabled()} method except that the
120: * marker data is also taken into account.
121: *
122: * @param marker The marker data to take into consideration
123: *
124: * @since 1.4
125: */
126: public boolean isTraceEnabled(Marker marker);
127:
128: /**
129: * Log a message with the specific Marker at the TRACE level.
130: *
131: * @param marker the marker data specific to this log statement
132: * @param msg the message string to be logged
133: *
134: * @since 1.4
135: */
136: public void trace(Marker marker, String msg);
137:
138: /**
139: * This method is similar to {@link #trace(String, Object)} method except that the
140: * marker data is also taken into consideration.
141: *
142: * @param marker the marker data specific to this log statement
143: * @param format the format string
144: * @param arg the argument
145: *
146: * @since 1.4
147: */
148: public void trace(Marker marker, String format, Object arg);
149:
150: /**
151: * This method is similar to {@link #trace(String, Object, Object)}
152: * method except that the marker data is also taken into
153: * consideration.
154: *
155: * @param marker the marker data specific to this log statement
156: * @param format the format string
157: * @param arg1 the first argument
158: * @param arg2 the second argument
159: *
160: * @since 1.4
161: */
162: public void trace(Marker marker, String format, Object arg1,
163: Object arg2);
164:
165: /**
166: * This method is similar to {@link #trace(String, Object[])}
167: * method except that the marker data is also taken into
168: * consideration.
169: *
170: * @param marker the marker data specific to this log statement
171: * @param format the format string
172: * @param argArray an array of arguments
173: *
174: * @since 1.4
175: */
176: public void trace(Marker marker, String format, Object[] argArray);
177:
178: /**
179: * This method is similar to {@link #trace(String, Throwable)} method except that the
180: * marker data is also taken into consideration.
181: *
182: * @param marker the marker data specific to this log statement
183: * @param msg the message accompanying the exception
184: * @param t the exception (throwable) to log
185: *
186: * @since 1.4
187: */
188: public void trace(Marker marker, String msg, Throwable t);
189:
190: /**
191: * Is the logger instance enabled for the DEBUG level?
192: * @return True if this Logger is enabled for the DEBUG level,
193: * false otherwise.
194: *
195: */
196: public boolean isDebugEnabled();
197:
198: /**
199: * Log a message at the DEBUG level.
200: *
201: * @param msg the message string to be logged
202: */
203: public void debug(String msg);
204:
205: /**
206: * Log a message at the DEBUG level according to the specified format
207: * and argument.
208: *
209: * <p>This form avoids superfluous object creation when the logger
210: * is disabled for the DEBUG level. </p>
211: *
212: * @param format the format string
213: * @param arg the argument
214: */
215: public void debug(String format, Object arg);
216:
217: /**
218: * Log a message at the DEBUG level according to the specified format
219: * and arguments.
220: *
221: * <p>This form avoids superfluous object creation when the logger
222: * is disabled for the DEBUG level. </p>
223: *
224: * @param format the format string
225: * @param arg1 the first argument
226: * @param arg2 the second argument
227: */
228: public void debug(String format, Object arg1, Object arg2);
229:
230: /**
231: * Log a message at the DEBUG level according to the specified format
232: * and arguments.
233: *
234: * <p>This form avoids superfluous object creation when the logger
235: * is disabled for the DEBUG level. </p>
236: *
237: * @param format the format string
238: * @param argArray an array of arguments
239: */
240: public void debug(String format, Object[] argArray);
241:
242: /**
243: * Log an exception (throwable) at the DEBUG level with an
244: * accompanying message.
245: *
246: * @param msg the message accompanying the exception
247: * @param t the exception (throwable) to log
248: */
249: public void debug(String msg, Throwable t);
250:
251: /**
252: * Similar to {@link #isDebugEnabled()} method except that the
253: * marker data is also taken into account.
254: *
255: * @param marker The marker data to take into consideration
256: */
257: public boolean isDebugEnabled(Marker marker);
258:
259: /**
260: * Log a message with the specific Marker at the DEBUG level.
261: *
262: * @param marker the marker data specific to this log statement
263: * @param msg the message string to be logged
264: */
265: public void debug(Marker marker, String msg);
266:
267: /**
268: * This method is similar to {@link #debug(String, Object)} method except that the
269: * marker data is also taken into consideration.
270: *
271: * @param marker the marker data specific to this log statement
272: * @param format the format string
273: * @param arg the argument
274: */
275: public void debug(Marker marker, String format, Object arg);
276:
277: /**
278: * This method is similar to {@link #debug(String, Object, Object)}
279: * method except that the marker data is also taken into
280: * consideration.
281: *
282: * @param marker the marker data specific to this log statement
283: * @param format the format string
284: * @param arg1 the first argument
285: * @param arg2 the second argument
286: */
287: public void debug(Marker marker, String format, Object arg1,
288: Object arg2);
289:
290: /**
291: * This method is similar to {@link #debug(String, Object[])}
292: * method except that the marker data is also taken into
293: * consideration.
294: *
295: * @param marker the marker data specific to this log statement
296: * @param format the format string
297: * @param argArray an array of arguments
298: */
299: public void debug(Marker marker, String format, Object[] argArray);
300:
301: /**
302: * This method is similar to {@link #debug(String, Throwable)} method except that the
303: * marker data is also taken into consideration.
304: *
305: * @param marker the marker data specific to this log statement
306: * @param msg the message accompanying the exception
307: * @param t the exception (throwable) to log
308: */
309: public void debug(Marker marker, String msg, Throwable t);
310:
311: /**
312: * Is the logger instance enabled for the INFO level?
313: * @return True if this Logger is enabled for the INFO level,
314: * false otherwise.
315: */
316: public boolean isInfoEnabled();
317:
318: /**
319: * Log a message at the INFO level.
320: *
321: * @param msg the message string to be logged
322: */
323: public void info(String msg);
324:
325: /**
326: * Log a message at the INFO level according to the specified format
327: * and argument.
328: *
329: * <p>This form avoids superfluous object creation when the logger
330: * is disabled for the INFO level. </p>
331: *
332: * @param format the format string
333: * @param arg the argument
334: */
335: public void info(String format, Object arg);
336:
337: /**
338: * Log a message at the INFO level according to the specified format
339: * and arguments.
340: *
341: * <p>This form avoids superfluous object creation when the logger
342: * is disabled for the INFO level. </p>
343: *
344: * @param format the format string
345: * @param arg1 the first argument
346: * @param arg2 the second argument
347: */
348: public void info(String format, Object arg1, Object arg2);
349:
350: /**
351: * Log a message at the INFO level according to the specified format
352: * and arguments.
353: *
354: * <p>This form avoids superfluous object creation when the logger
355: * is disabled for the INFO level. </p>
356: *
357: * @param format the format string
358: * @param argArray an array of arguments
359: */
360: public void info(String format, Object[] argArray);
361:
362: /**
363: * Log an exception (throwable) at the INFO level with an
364: * accompanying message.
365: *
366: * @param msg the message accompanying the exception
367: * @param t the exception (throwable) to log
368: */
369: public void info(String msg, Throwable t);
370:
371: /**
372: * Similar to {@link #isInfoEnabled()} method except that the marker
373: * data is also taken into consideration.
374: *
375: * @param marker The marker data to take into consideration
376: */
377: public boolean isInfoEnabled(Marker marker);
378:
379: /**
380: * Log a message with the specific Marker at the INFO level.
381: *
382: * @param marker The marker specific to this log statement
383: * @param msg the message string to be logged
384: */
385: public void info(Marker marker, String msg);
386:
387: /**
388: * This method is similar to {@link #info(String, Object)} method except that the
389: * marker data is also taken into consideration.
390: *
391: * @param marker the marker data specific to this log statement
392: * @param format the format string
393: * @param arg the argument
394: */
395: public void info(Marker marker, String format, Object arg);
396:
397: /**
398: * This method is similar to {@link #info(String, Object, Object)}
399: * method except that the marker data is also taken into
400: * consideration.
401: *
402: * @param marker the marker data specific to this log statement
403: * @param format the format string
404: * @param arg1 the first argument
405: * @param arg2 the second argument
406: */
407: public void info(Marker marker, String format, Object arg1,
408: Object arg2);
409:
410: /**
411: * This method is similar to {@link #info(String, Object[])}
412: * method except that the marker data is also taken into
413: * consideration.
414: *
415: * @param marker the marker data specific to this log statement
416: * @param format the format string
417: * @param argArray an array of arguments
418: */
419: public void info(Marker marker, String format, Object[] argArray);
420:
421: /**
422: * This method is similar to {@link #info(String, Throwable)} method
423: * except that the marker data is also taken into consideration.
424: *
425: * @param marker the marker data for this log statement
426: * @param msg the message accompanying the exception
427: * @param t the exception (throwable) to log
428: */
429: public void info(Marker marker, String msg, Throwable t);
430:
431: /**
432: * Is the logger instance enabled for the WARN level?
433: * @return True if this Logger is enabled for the WARN level,
434: * false otherwise.
435: */
436: public boolean isWarnEnabled();
437:
438: /**
439: * Log a message at the WARN level.
440: *
441: * @param msg the message string to be logged
442: */
443: public void warn(String msg);
444:
445: /**
446: * Log a message at the WARN level according to the specified format
447: * and argument.
448: *
449: * <p>This form avoids superfluous object creation when the logger
450: * is disabled for the WARN level. </p>
451: *
452: * @param format the format string
453: * @param arg the argument
454: */
455: public void warn(String format, Object arg);
456:
457: /**
458: * Log a message at the WARN level according to the specified format
459: * and arguments.
460: *
461: * <p>This form avoids superfluous object creation when the logger
462: * is disabled for the WARN level. </p>
463: *
464: * @param format the format string
465: * @param argArray an array of arguments
466: */
467: public void warn(String format, Object[] argArray);
468:
469: /**
470: * Log a message at the WARN level according to the specified format
471: * and arguments.
472: *
473: * <p>This form avoids superfluous object creation when the logger
474: * is disabled for the WARN level. </p>
475: *
476: * @param format the format string
477: * @param arg1 the first argument
478: * @param arg2 the second argument
479: */
480: public void warn(String format, Object arg1, Object arg2);
481:
482: /**
483: * Log an exception (throwable) at the WARN level with an
484: * accompanying message.
485: *
486: * @param msg the message accompanying the exception
487: * @param t the exception (throwable) to log
488: */
489: public void warn(String msg, Throwable t);
490:
491: /**
492: * Similar to {@link #isWarnEnabled()} method except that the marker
493: * data is also taken into consideration.
494: *
495: * @param marker The marker data to take into consideration
496: */
497: public boolean isWarnEnabled(Marker marker);
498:
499: /**
500: * Log a message with the specific Marker at the WARN level.
501: *
502: * @param marker The marker specific to this log statement
503: * @param msg the message string to be logged
504: */
505: public void warn(Marker marker, String msg);
506:
507: /**
508: * This method is similar to {@link #warn(String, Object)} method except that the
509: * marker data is also taken into consideration.
510: *
511: * @param marker the marker data specific to this log statement
512: * @param format the format string
513: * @param arg the argument
514: */
515: public void warn(Marker marker, String format, Object arg);
516:
517: /**
518: * This method is similar to {@link #warn(String, Object, Object)}
519: * method except that the marker data is also taken into
520: * consideration.
521: *
522: * @param marker the marker data specific to this log statement
523: * @param format the format string
524: * @param arg1 the first argument
525: * @param arg2 the second argument
526: */
527: public void warn(Marker marker, String format, Object arg1,
528: Object arg2);
529:
530: /**
531: * This method is similar to {@link #warn(String, Object[])}
532: * method except that the marker data is also taken into
533: * consideration.
534: *
535: * @param marker the marker data specific to this log statement
536: * @param format the format string
537: * @param argArray an array of arguments
538: */
539: public void warn(Marker marker, String format, Object[] argArray);
540:
541: /**
542: * This method is similar to {@link #warn(String, Throwable)} method
543: * except that the marker data is also taken into consideration.
544: *
545: * @param marker the marker data for this log statement
546: * @param msg the message accompanying the exception
547: * @param t the exception (throwable) to log
548: */
549: public void warn(Marker marker, String msg, Throwable t);
550:
551: /**
552: * Is the logger instance enabled for the ERROR level?
553: * @return True if this Logger is enabled for the ERROR level,
554: * false otherwise.
555: */
556: public boolean isErrorEnabled();
557:
558: /**
559: * Log a message at the ERROR level.
560: *
561: * @param msg the message string to be logged
562: */
563: public void error(String msg);
564:
565: /**
566: * Log a message at the ERROR level according to the specified format
567: * and argument.
568: *
569: * <p>This form avoids superfluous object creation when the logger
570: * is disabled for the ERROR level. </p>
571: *
572: * @param format the format string
573: * @param arg the argument
574: */
575: public void error(String format, Object arg);
576:
577: /**
578: * Log a message at the ERROR level according to the specified format
579: * and arguments.
580: *
581: * <p>This form avoids superfluous object creation when the logger
582: * is disabled for the ERROR level. </p>
583: *
584: * @param format the format string
585: * @param arg1 the first argument
586: * @param arg2 the second argument
587: */
588: public void error(String format, Object arg1, Object arg2);
589:
590: /**
591: * Log a message at the ERROR level according to the specified format
592: * and arguments.
593: *
594: * <p>This form avoids superfluous object creation when the logger
595: * is disabled for the ERROR level. </p>
596: *
597: * @param format the format string
598: * @param argArray an array of arguments
599: */
600: public void error(String format, Object[] argArray);
601:
602: /**
603: * Log an exception (throwable) at the ERROR level with an
604: * accompanying message.
605: *
606: * @param msg the message accompanying the exception
607: * @param t the exception (throwable) to log
608: */
609: public void error(String msg, Throwable t);
610:
611: /**
612: * Similar to {@link #isErrorEnabled()} method except that the
613: * marker data is also taken into consideration.
614: *
615: * @param marker The marker data to take into consideration
616: */
617: public boolean isErrorEnabled(Marker marker);
618:
619: /**
620: * Log a message with the specific Marker at the ERROR level.
621: *
622: * @param marker The marker specific to this log statement
623: * @param msg the message string to be logged
624: */
625: public void error(Marker marker, String msg);
626:
627: /**
628: * This method is similar to {@link #error(String, Object)} method except that the
629: * marker data is also taken into consideration.
630: *
631: * @param marker the marker data specific to this log statement
632: * @param format the format string
633: * @param arg the argument
634: */
635: public void error(Marker marker, String format, Object arg);
636:
637: /**
638: * This method is similar to {@link #error(String, Object, Object)}
639: * method except that the marker data is also taken into
640: * consideration.
641: *
642: * @param marker the marker data specific to this log statement
643: * @param format the format string
644: * @param arg1 the first argument
645: * @param arg2 the second argument
646: */
647: public void error(Marker marker, String format, Object arg1,
648: Object arg2);
649:
650: /**
651: * This method is similar to {@link #error(String, Object[])}
652: * method except that the marker data is also taken into
653: * consideration.
654: *
655: * @param marker the marker data specific to this log statement
656: * @param format the format string
657: * @param argArray an array of arguments
658: */
659: public void error(Marker marker, String format, Object[] argArray);
660:
661: /**
662: * This method is similar to {@link #error(String, Throwable)}
663: * method except that the marker data is also taken into
664: * consideration.
665: *
666: * @param marker the marker data specific to this log statement
667: * @param msg the message accompanying the exception
668: * @param t the exception (throwable) to log
669: */
670: public void error(Marker marker, String msg, Throwable t);
671:
672: }
|