View Javadoc
1   /**
2    * Copyright (c) 2004-2011 QOS.ch
3    * All rights reserved.
4    *
5    * Permission is hereby granted, free  of charge, to any person obtaining
6    * a  copy  of this  software  and  associated  documentation files  (the
7    * "Software"), to  deal in  the Software without  restriction, including
8    * without limitation  the rights to  use, copy, modify,  merge, publish,
9    * distribute,  sublicense, and/or sell  copies of  the Software,  and to
10   * permit persons to whom the Software  is furnished to do so, subject to
11   * the following conditions:
12   *
13   * The  above  copyright  notice  and  this permission  notice  shall  be
14   * included in all copies or substantial portions of the Software.
15   *
16   * THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
17   * EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
18   * MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
19   * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20   * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21   * OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
22   * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23   *
24   */
25  
26  package org.slf4j;
27  
28  import static org.slf4j.event.EventConstants.DEBUG_INT;
29  import static org.slf4j.event.EventConstants.ERROR_INT;
30  import static org.slf4j.event.EventConstants.INFO_INT;
31  import static org.slf4j.event.EventConstants.TRACE_INT;
32  import static org.slf4j.event.EventConstants.WARN_INT;
33  import static org.slf4j.event.Level.DEBUG;
34  import static org.slf4j.event.Level.ERROR;
35  import static org.slf4j.event.Level.INFO;
36  import static org.slf4j.event.Level.TRACE;
37  import static org.slf4j.event.Level.WARN;
38  
39  import org.slf4j.event.Level;
40  import org.slf4j.spi.DefaultLoggingEventBuilder;
41  import org.slf4j.spi.LoggingEventBuilder;
42  import org.slf4j.spi.NOPLoggingEventBuilder;
43  
44  /**
45   * The org.slf4j.Logger interface is the main user entry point of SLF4J API.
46   * It is expected that logging takes place through concrete implementations
47   * of this interface.
48   * 
49   * <h3>Typical usage pattern:</h3>
50   * <pre>
51   * import org.slf4j.Logger;
52   * import org.slf4j.LoggerFactory;
53   *
54   * public class Wombat {
55   *
56   *   <span style="color:green">final static Logger logger = LoggerFactory.getLogger(Wombat.class);</span>
57   *   Integer t;
58   *   Integer oldT;
59   *
60   *   public void setTemperature(Integer temperature) {
61   *     oldT = t;
62   *     t = temperature;
63   *     <span style="color:green">logger.debug("Temperature set to {}. Old temperature was {}.", t, oldT);</span>
64   *     if(temperature.intValue() &gt; 50) {
65   *       <span style="color:green">logger.info("Temperature has risen above 50 degrees.");</span>
66   *     }
67   *   }
68   * }
69   * </pre>
70   *
71   * <p>Note that version 2.0 of the SLF4J API introduces a <a href="../../../manual.html#fluent">fluent api</a>,
72   * the most significant API change to occur in the last 20 years.
73   *
74   * <p>Be sure to read the FAQ entry relating to <a href="../../../faq.html#logging_performance">parameterized
75   * logging</a>. Note that logging statements can be parameterized in
76   * <a href="../../../faq.html#paramException">presence of an exception/throwable</a>.
77   *
78   * <p>Once you are comfortable using loggers, i.e. instances of this interface, consider using
79   * <a href="MDC.html">MDC</a> as well as <a href="Marker.html">Markers</a>.
80   *
81   * @author Ceki G&uuml;lc&uuml;
82   */
83  public interface Logger {
84  
85      /**
86       * Case insensitive String constant used to retrieve the name of the root logger.
87       *
88       * @since 1.3
89       */
90      final public String ROOT_LOGGER_NAME = "ROOT";
91  
92      /**
93       * Return the name of this <code>Logger</code> instance.
94       * @return name of this logger instance 
95       */
96      public String getName();
97  
98      /**
99       * Make a new {@link LoggingEventBuilder} instance as appropriate for this logger and the 
100      * desired {@link Level} passed as parameter. If this Logger is disabled for the given Level, then 
101      * a {@link  NOPLoggingEventBuilder} is returned.
102      * 
103      * 
104      * @param level desired level for the event builder
105      * @return a new {@link LoggingEventBuilder} instance as appropriate for this logger
106      * @since 2.0
107      */
108     default public LoggingEventBuilder makeLoggingEventBuilder(Level level) {
109         if(isEnabledForLevel(level)) {
110             return new DefaultLoggingEventBuilder(this, level);          
111         } else {
112             return NOPLoggingEventBuilder.singleton();
113         }
114     }
115 
116     /**
117      * Returns whether this Logger is enabled for a given {@link Level}. 
118      * 
119      * @param level
120      * @return true if enabled, false otherwise.
121      */
122     default public boolean isEnabledForLevel(Level level) {
123         int levelInt = level.toInt();
124         switch (levelInt) {
125         case (TRACE_INT):
126             return isTraceEnabled();
127         case (DEBUG_INT):
128             return isDebugEnabled();
129         case (INFO_INT):
130             return isInfoEnabled();
131         case (WARN_INT):
132             return isWarnEnabled();
133         case (ERROR_INT):
134             return isErrorEnabled();
135         default:
136             throw new IllegalArgumentException("Level [" + level + "] not recognized.");
137         }
138     }
139 
140     /**
141      * Is the logger instance enabled for the TRACE level?
142      *
143      * @return True if this Logger is enabled for the TRACE level,
144      *         false otherwise.
145      * @since 1.4
146      */
147     public boolean isTraceEnabled();
148 
149     /**
150      * Log a message at the TRACE level.
151      *
152      * @param msg the message string to be logged
153      * @since 1.4
154      */
155     public void trace(String msg);
156 
157     /**
158      * Log a message at the TRACE level according to the specified format
159      * and argument.
160      * 
161      * <p>This form avoids superfluous object creation when the logger
162      * is disabled for the TRACE level. 
163      *
164      * @param format the format string
165      * @param arg    the argument
166      * @since 1.4
167      */
168     public void trace(String format, Object arg);
169 
170     /**
171      * Log a message at the TRACE level according to the specified format
172      * and arguments.
173      * 
174      * <p>This form avoids superfluous object creation when the logger
175      * is disabled for the TRACE level. 
176      *
177      * @param format the format string
178      * @param arg1   the first argument
179      * @param arg2   the second argument
180      * @since 1.4
181      */
182     public void trace(String format, Object arg1, Object arg2);
183 
184     /**
185      * Log a message at the TRACE level according to the specified format
186      * and arguments.
187      * 
188      * <p>This form avoids superfluous string concatenation when the logger
189      * is disabled for the TRACE level. However, this variant incurs the hidden
190      * (and relatively small) cost of creating an <code>Object[]</code> before invoking the method,
191      * even if this logger is disabled for TRACE. The variants taking {@link #trace(String, Object) one} and
192      * {@link #trace(String, Object, Object) two} arguments exist solely in order to avoid this hidden cost.
193      *
194      * @param format    the format string
195      * @param arguments a list of 3 or more arguments
196      * @since 1.4
197      */
198     public void trace(String format, Object... arguments);
199 
200     /**
201      * Log an exception (throwable) at the TRACE level with an
202      * accompanying message.
203      *
204      * @param msg the message accompanying the exception
205      * @param t   the exception (throwable) to log
206      * @since 1.4
207      */
208     public void trace(String msg, Throwable t);
209 
210     /**
211      * Similar to {@link #isTraceEnabled()} method except that the
212      * marker data is also taken into account.
213      *
214      * @param marker The marker data to take into consideration
215      * @return True if this Logger is enabled for the TRACE level,
216      *         false otherwise.
217      *         
218      * @since 1.4
219      */
220     public boolean isTraceEnabled(Marker marker);
221 
222     /**
223      * Entry point for fluent-logging for {@link org.slf4j.event.Level#TRACE} level. 
224      *  
225      * @return LoggingEventBuilder instance as appropriate for level TRACE
226      * @since 2.0
227      */
228     default public LoggingEventBuilder atTrace() {
229         if (isTraceEnabled()) {
230             return makeLoggingEventBuilder(TRACE);
231         } else {
232             return NOPLoggingEventBuilder.singleton();
233         }
234     }
235 
236     /**
237      * Log a message with the specific Marker at the TRACE level.
238      *
239      * @param marker the marker data specific to this log statement
240      * @param msg    the message string to be logged
241      * @since 1.4
242      */
243     public void trace(Marker marker, String msg);
244 
245     /**
246      * This method is similar to {@link #trace(String, Object)} method except that the
247      * marker data is also taken into consideration.
248      *
249      * @param marker the marker data specific to this log statement
250      * @param format the format string
251      * @param arg    the argument
252      * @since 1.4
253      */
254     public void trace(Marker marker, String format, Object arg);
255 
256     /**
257      * This method is similar to {@link #trace(String, Object, Object)}
258      * method except that the marker data is also taken into
259      * consideration.
260      *
261      * @param marker the marker data specific to this log statement
262      * @param format the format string
263      * @param arg1   the first argument
264      * @param arg2   the second argument
265      * @since 1.4
266      */
267     public void trace(Marker marker, String format, Object arg1, Object arg2);
268 
269     /**
270      * This method is similar to {@link #trace(String, Object...)}
271      * method except that the marker data is also taken into
272      * consideration.
273      *
274      * @param marker   the marker data specific to this log statement
275      * @param format   the format string
276      * @param argArray an array of arguments
277      * @since 1.4
278      */
279     public void trace(Marker marker, String format, Object... argArray);
280 
281     /**
282      * This method is similar to {@link #trace(String, Throwable)} method except that the
283      * marker data is also taken into consideration.
284      *
285      * @param marker the marker data specific to this log statement
286      * @param msg    the message accompanying the exception
287      * @param t      the exception (throwable) to log
288      * @since 1.4
289      */
290     public void trace(Marker marker, String msg, Throwable t);
291 
292     /**
293      * Is the logger instance enabled for the DEBUG level?
294      *
295      * @return True if this Logger is enabled for the DEBUG level,
296      *         false otherwise.
297      */
298     public boolean isDebugEnabled();
299 
300     /**
301      * Log a message at the DEBUG level.
302      *
303      * @param msg the message string to be logged
304      */
305     public void debug(String msg);
306 
307     /**
308      * Log a message at the DEBUG level according to the specified format
309      * and argument.
310      * 
311      * <p>This form avoids superfluous object creation when the logger
312      * is disabled for the DEBUG level. 
313      *
314      * @param format the format string
315      * @param arg    the argument
316      */
317     public void debug(String format, Object arg);
318 
319     /**
320      * Log a message at the DEBUG level according to the specified format
321      * and arguments.
322      * 
323      * <p>This form avoids superfluous object creation when the logger
324      * is disabled for the DEBUG level. 
325      *
326      * @param format the format string
327      * @param arg1   the first argument
328      * @param arg2   the second argument
329      */
330     public void debug(String format, Object arg1, Object arg2);
331 
332     /**
333      * Log a message at the DEBUG level according to the specified format
334      * and arguments.
335      * 
336      * <p>This form avoids superfluous string concatenation when the logger
337      * is disabled for the DEBUG level. However, this variant incurs the hidden
338      * (and relatively small) cost of creating an <code>Object[]</code> before invoking the method,
339      * even if this logger is disabled for DEBUG. The variants taking
340      * {@link #debug(String, Object) one} and {@link #debug(String, Object, Object) two}
341      * arguments exist solely in order to avoid this hidden cost.
342      *
343      * @param format    the format string
344      * @param arguments a list of 3 or more arguments
345      */
346     public void debug(String format, Object... arguments);
347 
348     /**
349      * Log an exception (throwable) at the DEBUG level with an
350      * accompanying message.
351      *
352      * @param msg the message accompanying the exception
353      * @param t   the exception (throwable) to log
354      */
355     public void debug(String msg, Throwable t);
356 
357     /**
358      * Similar to {@link #isDebugEnabled()} method except that the
359      * marker data is also taken into account.
360      *
361      * @param marker The marker data to take into consideration
362      * @return True if this Logger is enabled for the DEBUG level,
363      *         false otherwise. 
364      */
365     public boolean isDebugEnabled(Marker marker);
366 
367     /**
368      * Log a message with the specific Marker at the DEBUG level.
369      *
370      * @param marker the marker data specific to this log statement
371      * @param msg    the message string to be logged
372      */
373     public void debug(Marker marker, String msg);
374 
375     /**
376      * This method is similar to {@link #debug(String, Object)} method except that the
377      * marker data is also taken into consideration.
378      *
379      * @param marker the marker data specific to this log statement
380      * @param format the format string
381      * @param arg    the argument
382      */
383     public void debug(Marker marker, String format, Object arg);
384 
385     /**
386      * This method is similar to {@link #debug(String, Object, Object)}
387      * method except that the marker data is also taken into
388      * consideration.
389      *
390      * @param marker the marker data specific to this log statement
391      * @param format the format string
392      * @param arg1   the first argument
393      * @param arg2   the second argument
394      */
395     public void debug(Marker marker, String format, Object arg1, Object arg2);
396 
397     /**
398      * This method is similar to {@link #debug(String, 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 arguments a list of 3 or more arguments
405      */
406     public void debug(Marker marker, String format, Object... arguments);
407 
408     /**
409      * This method is similar to {@link #debug(String, Throwable)} method except that the
410      * marker data is also taken into consideration.
411      *
412      * @param marker the marker data specific to this log statement
413      * @param msg    the message accompanying the exception
414      * @param t      the exception (throwable) to log
415      */
416     public void debug(Marker marker, String msg, Throwable t);
417 
418     /**
419      * Entry point for fluent-logging for {@link org.slf4j.event.Level#DEBUG} level. 
420      *  
421      * @return LoggingEventBuilder instance as appropriate for level DEBUG
422      * @since 2.0
423      */
424     default public LoggingEventBuilder atDebug() {
425         if (isDebugEnabled()) {
426             return makeLoggingEventBuilder(DEBUG);
427         } else {
428             return NOPLoggingEventBuilder.singleton();
429         }
430     }
431 
432     /**
433      * Is the logger instance enabled for the INFO level?
434      *
435      * @return True if this Logger is enabled for the INFO level,
436      *         false otherwise.
437      */
438     public boolean isInfoEnabled();
439 
440     /**
441      * Log a message at the INFO level.
442      *
443      * @param msg the message string to be logged
444      */
445     public void info(String msg);
446 
447     /**
448      * Log a message at the INFO level according to the specified format
449      * and argument.
450      * 
451      * <p>This form avoids superfluous object creation when the logger
452      * is disabled for the INFO level. 
453      *
454      * @param format the format string
455      * @param arg    the argument
456      */
457     public void info(String format, Object arg);
458 
459     /**
460      * Log a message at the INFO level according to the specified format
461      * and arguments.
462      * 
463      * <p>This form avoids superfluous object creation when the logger
464      * is disabled for the INFO level. 
465      *
466      * @param format the format string
467      * @param arg1   the first argument
468      * @param arg2   the second argument
469      */
470     public void info(String format, Object arg1, Object arg2);
471 
472     /**
473      * Log a message at the INFO level according to the specified format
474      * and arguments.
475      * 
476      * <p>This form avoids superfluous string concatenation when the logger
477      * is disabled for the INFO level. However, this variant incurs the hidden
478      * (and relatively small) cost of creating an <code>Object[]</code> before invoking the method,
479      * even if this logger is disabled for INFO. The variants taking
480      * {@link #info(String, Object) one} and {@link #info(String, Object, Object) two}
481      * arguments exist solely in order to avoid this hidden cost.
482      *
483      * @param format    the format string
484      * @param arguments a list of 3 or more arguments
485      */
486     public void info(String format, Object... arguments);
487 
488     /**
489      * Log an exception (throwable) at the INFO level with an
490      * accompanying message.
491      *
492      * @param msg the message accompanying the exception
493      * @param t   the exception (throwable) to log
494      */
495     public void info(String msg, Throwable t);
496 
497     /**
498      * Similar to {@link #isInfoEnabled()} method except that the marker
499      * data is also taken into consideration.
500      *
501      * @param marker The marker data to take into consideration
502      * @return true if this logger is warn enabled, false otherwise 
503      */
504     public boolean isInfoEnabled(Marker marker);
505 
506     /**
507      * Log a message with the specific Marker at the INFO level.
508      *
509      * @param marker The marker specific to this log statement
510      * @param msg    the message string to be logged
511      */
512     public void info(Marker marker, String msg);
513 
514     /**
515      * This method is similar to {@link #info(String, Object)} method except that the
516      * marker data is also taken into consideration.
517      *
518      * @param marker the marker data specific to this log statement
519      * @param format the format string
520      * @param arg    the argument
521      */
522     public void info(Marker marker, String format, Object arg);
523 
524     /**
525      * This method is similar to {@link #info(String, Object, Object)}
526      * method except that the marker data is also taken into
527      * consideration.
528      *
529      * @param marker the marker data specific to this log statement
530      * @param format the format string
531      * @param arg1   the first argument
532      * @param arg2   the second argument
533      */
534     public void info(Marker marker, String format, Object arg1, Object arg2);
535 
536     /**
537      * This method is similar to {@link #info(String, Object...)}
538      * method except that the marker data is also taken into
539      * consideration.
540      *
541      * @param marker    the marker data specific to this log statement
542      * @param format    the format string
543      * @param arguments a list of 3 or more arguments
544      */
545     public void info(Marker marker, String format, Object... arguments);
546 
547     /**
548      * This method is similar to {@link #info(String, Throwable)} method
549      * except that the marker data is also taken into consideration.
550      *
551      * @param marker the marker data for this log statement
552      * @param msg    the message accompanying the exception
553      * @param t      the exception (throwable) to log
554      */
555     public void info(Marker marker, String msg, Throwable t);
556 
557     /**
558      * Entry point for fluent-logging for {@link org.slf4j.event.Level#INFO} level. 
559      *  
560      * @return LoggingEventBuilder instance as appropriate for level INFO
561      * @since 2.0
562      */
563     default public LoggingEventBuilder atInfo() {
564         if (isInfoEnabled()) {
565             return makeLoggingEventBuilder(INFO);
566         } else {
567             return NOPLoggingEventBuilder.singleton();
568         }
569     }
570 
571     /**
572      * Is the logger instance enabled for the WARN level?
573      *
574      * @return True if this Logger is enabled for the WARN level,
575      *         false otherwise.
576      */
577     public boolean isWarnEnabled();
578 
579     /**
580      * Log a message at the WARN level.
581      *
582      * @param msg the message string to be logged
583      */
584     public void warn(String msg);
585 
586     /**
587      * Log a message at the WARN level according to the specified format
588      * and argument.
589      * 
590      * <p>This form avoids superfluous object creation when the logger
591      * is disabled for the WARN level. 
592      *
593      * @param format the format string
594      * @param arg    the argument
595      */
596     public void warn(String format, Object arg);
597 
598     /**
599      * Log a message at the WARN level according to the specified format
600      * and arguments.
601      * 
602      * <p>This form avoids superfluous string concatenation when the logger
603      * is disabled for the WARN level. However, this variant incurs the hidden
604      * (and relatively small) cost of creating an <code>Object[]</code> before invoking the method,
605      * even if this logger is disabled for WARN. The variants taking
606      * {@link #warn(String, Object) one} and {@link #warn(String, Object, Object) two}
607      * arguments exist solely in order to avoid this hidden cost.
608      *
609      * @param format    the format string
610      * @param arguments a list of 3 or more arguments
611      */
612     public void warn(String format, Object... arguments);
613 
614     /**
615      * Log a message at the WARN level according to the specified format
616      * and arguments.
617      * 
618      * <p>This form avoids superfluous object creation when the logger
619      * is disabled for the WARN level. 
620      *
621      * @param format the format string
622      * @param arg1   the first argument
623      * @param arg2   the second argument
624      */
625     public void warn(String format, Object arg1, Object arg2);
626 
627     /**
628      * Log an exception (throwable) at the WARN level with an
629      * accompanying message.
630      *
631      * @param msg the message accompanying the exception
632      * @param t   the exception (throwable) to log
633      */
634     public void warn(String msg, Throwable t);
635 
636     /**
637      * Similar to {@link #isWarnEnabled()} method except that the marker
638      * data is also taken into consideration.
639      *
640      * @param marker The marker data to take into consideration
641      * @return True if this Logger is enabled for the WARN level,
642      *         false otherwise.
643      */
644     public boolean isWarnEnabled(Marker marker);
645 
646     /**
647      * Log a message with the specific Marker at the WARN level.
648      *
649      * @param marker The marker specific to this log statement
650      * @param msg    the message string to be logged
651      */
652     public void warn(Marker marker, String msg);
653 
654     /**
655      * This method is similar to {@link #warn(String, Object)} method except that the
656      * marker data is also taken into consideration.
657      *
658      * @param marker the marker data specific to this log statement
659      * @param format the format string
660      * @param arg    the argument
661      */
662     public void warn(Marker marker, String format, Object arg);
663 
664     /**
665      * This method is similar to {@link #warn(String, Object, Object)}
666      * method except that the marker data is also taken into
667      * consideration.
668      *
669      * @param marker the marker data specific to this log statement
670      * @param format the format string
671      * @param arg1   the first argument
672      * @param arg2   the second argument
673      */
674     public void warn(Marker marker, String format, Object arg1, Object arg2);
675 
676     /**
677      * This method is similar to {@link #warn(String, Object...)}
678      * method except that the marker data is also taken into
679      * consideration.
680      *
681      * @param marker    the marker data specific to this log statement
682      * @param format    the format string
683      * @param arguments a list of 3 or more arguments
684      */
685     public void warn(Marker marker, String format, Object... arguments);
686 
687     /**
688      * This method is similar to {@link #warn(String, Throwable)} method
689      * except that the marker data is also taken into consideration.
690      *
691      * @param marker the marker data for this log statement
692      * @param msg    the message accompanying the exception
693      * @param t      the exception (throwable) to log
694      */
695     public void warn(Marker marker, String msg, Throwable t);
696 
697     /**
698      * Entry point for fluent-logging for {@link org.slf4j.event.Level#WARN} level. 
699      *  
700      * @return LoggingEventBuilder instance as appropriate for level WARN
701      * @since 2.0
702      */
703     default public LoggingEventBuilder atWarn() {
704         if (isWarnEnabled()) {
705             return makeLoggingEventBuilder(WARN);
706         } else {
707             return NOPLoggingEventBuilder.singleton();
708         }
709     }
710 
711     /**
712      * Is the logger instance enabled for the ERROR level?
713      *
714      * @return True if this Logger is enabled for the ERROR level,
715      *         false otherwise.
716      */
717     public boolean isErrorEnabled();
718 
719     /**
720      * Log a message at the ERROR level.
721      *
722      * @param msg the message string to be logged
723      */
724     public void error(String msg);
725 
726     /**
727      * Log a message at the ERROR level according to the specified format
728      * and argument.
729      * 
730      * <p>This form avoids superfluous object creation when the logger
731      * is disabled for the ERROR level. 
732      *
733      * @param format the format string
734      * @param arg    the argument
735      */
736     public void error(String format, Object arg);
737 
738     /**
739      * Log a message at the ERROR level according to the specified format
740      * and arguments.
741      * 
742      * <p>This form avoids superfluous object creation when the logger
743      * is disabled for the ERROR level. 
744      *
745      * @param format the format string
746      * @param arg1   the first argument
747      * @param arg2   the second argument
748      */
749     public void error(String format, Object arg1, Object arg2);
750 
751     /**
752      * Log a message at the ERROR level according to the specified format
753      * and arguments.
754      * 
755      * <p>This form avoids superfluous string concatenation when the logger
756      * is disabled for the ERROR level. However, this variant incurs the hidden
757      * (and relatively small) cost of creating an <code>Object[]</code> before invoking the method,
758      * even if this logger is disabled for ERROR. The variants taking
759      * {@link #error(String, Object) one} and {@link #error(String, Object, Object) two}
760      * arguments exist solely in order to avoid this hidden cost.
761      *
762      * @param format    the format string
763      * @param arguments a list of 3 or more arguments
764      */
765     public void error(String format, Object... arguments);
766 
767     /**
768      * Log an exception (throwable) at the ERROR level with an
769      * accompanying message.
770      *
771      * @param msg the message accompanying the exception
772      * @param t   the exception (throwable) to log
773      */
774     public void error(String msg, Throwable t);
775 
776     /**
777      * Similar to {@link #isErrorEnabled()} method except that the
778      * marker data is also taken into consideration.
779      *
780      * @param marker The marker data to take into consideration
781      * @return True if this Logger is enabled for the ERROR level,
782      *         false otherwise.
783      */
784     public boolean isErrorEnabled(Marker marker);
785 
786     /**
787      * Log a message with the specific Marker at the ERROR level.
788      *
789      * @param marker The marker specific to this log statement
790      * @param msg    the message string to be logged
791      */
792     public void error(Marker marker, String msg);
793 
794     /**
795      * This method is similar to {@link #error(String, Object)} method except that the
796      * marker data is also taken into consideration.
797      *
798      * @param marker the marker data specific to this log statement
799      * @param format the format string
800      * @param arg    the argument
801      */
802     public void error(Marker marker, String format, Object arg);
803 
804     /**
805      * This method is similar to {@link #error(String, Object, Object)}
806      * method except that the marker data is also taken into
807      * consideration.
808      *
809      * @param marker the marker data specific to this log statement
810      * @param format the format string
811      * @param arg1   the first argument
812      * @param arg2   the second argument
813      */
814     public void error(Marker marker, String format, Object arg1, Object arg2);
815 
816     /**
817      * This method is similar to {@link #error(String, Object...)}
818      * method except that the marker data is also taken into
819      * consideration.
820      *
821      * @param marker    the marker data specific to this log statement
822      * @param format    the format string
823      * @param arguments a list of 3 or more arguments
824      */
825     public void error(Marker marker, String format, Object... arguments);
826 
827     /**
828      * This method is similar to {@link #error(String, Throwable)}
829      * method except that the marker data is also taken into
830      * consideration.
831      *
832      * @param marker the marker data specific to this log statement
833      * @param msg    the message accompanying the exception
834      * @param t      the exception (throwable) to log
835      */
836     public void error(Marker marker, String msg, Throwable t);
837 
838     /**
839      * Entry point for fluent-logging for {@link org.slf4j.event.Level#ERROR} level. 
840      *  
841      * @return LoggingEventBuilder instance as appropriate for level ERROR
842      * @since 2.0
843      */
844     default public LoggingEventBuilder atError() {
845         if (isErrorEnabled()) {
846             return makeLoggingEventBuilder(ERROR);
847         } else {
848             return NOPLoggingEventBuilder.singleton();
849         }
850     }
851 
852 }