001/**
002 * Copyright (c) 2004-2022 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
026package org.slf4j;
027
028import static org.slf4j.event.EventConstants.DEBUG_INT;
029import static org.slf4j.event.EventConstants.ERROR_INT;
030import static org.slf4j.event.EventConstants.INFO_INT;
031import static org.slf4j.event.EventConstants.TRACE_INT;
032import static org.slf4j.event.EventConstants.WARN_INT;
033import static org.slf4j.event.Level.DEBUG;
034import static org.slf4j.event.Level.ERROR;
035import static org.slf4j.event.Level.INFO;
036import static org.slf4j.event.Level.TRACE;
037import static org.slf4j.event.Level.WARN;
038
039import org.slf4j.event.Level;
040import org.slf4j.helpers.CheckReturnValue;
041import org.slf4j.spi.DefaultLoggingEventBuilder;
042import org.slf4j.spi.LoggingEventBuilder;
043import org.slf4j.spi.NOPLoggingEventBuilder;
044
045/**
046 * The org.slf4j.Logger interface is the main user entry point of SLF4J API.
047 * It is expected that logging takes place through concrete implementations
048 * of this interface.
049 * 
050 * <H3>Typical usage pattern:</H3>
051 * <pre>
052 * import org.slf4j.Logger;
053 * import org.slf4j.LoggerFactory;
054 *
055 * public class Wombat {
056 *
057 *   <span style="color:green">final static Logger logger = LoggerFactory.getLogger(Wombat.class);</span>
058 *   Integer t;
059 *   Integer oldT;
060 *
061 *   public void setTemperature(Integer temperature) {
062 *     oldT = t;
063 *     t = temperature;
064 *     <span style="color:green">logger.debug("Temperature set to {}. Old temperature was {}.", t, oldT);</span>
065 *     if (temperature.intValue() &gt; 50) {
066 *       <span style="color:green">logger.info("Temperature has risen above 50 degrees.");</span>
067 *     }
068 *   }
069 * }
070 * </pre>
071 *
072 * <p>Note that version 2.0 of the SLF4J API introduces a <a href="../../../manual.html#fluent">fluent api</a>,
073 * the most significant API change to occur in the last 20 years.
074 *
075 * <p>Be sure to read the FAQ entry relating to <a href="../../../faq.html#logging_performance">parameterized
076 * logging</a>. Note that logging statements can be parameterized in
077 * <a href="../../../faq.html#paramException">presence of an exception/throwable</a>.
078 *
079 * <p>Once you are comfortable using loggers, i.e. instances of this interface, consider using
080 * <a href="MDC.html">MDC</a> as well as <a href="Marker.html">Markers</a>.
081 *
082 * @author Ceki G&uuml;lc&uuml;
083 */
084public interface Logger {
085
086    /**
087     * Case-insensitive String constant used to retrieve the name of the root logger.
088     *
089     * @since 1.3
090     */
091    final public String ROOT_LOGGER_NAME = "ROOT";
092
093    /**
094     * Return the name of this <code>Logger</code> instance.
095     * @return name of this logger instance 
096     */
097    public String getName();
098
099    /**
100     * <p>Make a new {@link LoggingEventBuilder} instance as appropriate for this logger implementation.
101     * This default implementation always returns a new instance of {@link DefaultLoggingEventBuilder}.</p>
102     * <p></p>
103     * <p>This method is intended to be used by logging systems implementing the SLF4J API and <b>not</b>
104     * by end users.</p>
105     * <p></p>
106     * <p>Also note that a {@link LoggingEventBuilder} instance should be built for all levels,
107     * independently of the level argument. In other words, this method is an <b>unconditional</b>
108     * constructor for the {@link LoggingEventBuilder} appropriate for this logger implementation.</p>
109     * <p></p>
110     * @param level desired level for the event builder
111     * @return a new {@link LoggingEventBuilder} instance as appropriate for <b>this</b> logger
112     * @since 2.0
113     */
114    default public LoggingEventBuilder makeLoggingEventBuilder(Level level) {
115        return new DefaultLoggingEventBuilder(this, level);
116    }
117
118    /**
119     * Make a new {@link LoggingEventBuilder} instance as appropriate for this logger and the
120     * desired {@link Level} passed as parameter. If this Logger is disabled for the given Level, then
121     * a {@link  NOPLoggingEventBuilder} is returned.
122     *
123     *
124     * @param level desired level for the event builder
125     * @return a new {@link LoggingEventBuilder} instance as appropriate for this logger
126     * @since 2.0
127     */
128    @CheckReturnValue
129    default public LoggingEventBuilder atLevel(Level level) {
130        if (isEnabledForLevel(level)) {
131            return makeLoggingEventBuilder(level);
132        } else {
133            return NOPLoggingEventBuilder.singleton();
134        }
135    }
136
137    
138    
139    /**
140     * Returns whether this Logger is enabled for a given {@link Level}. 
141     * 
142     * @param level
143     * @return true if enabled, false otherwise.
144     */
145    default public boolean isEnabledForLevel(Level level) {
146        int levelInt = level.toInt();
147        switch (levelInt) {
148        case (TRACE_INT):
149            return isTraceEnabled();
150        case (DEBUG_INT):
151            return isDebugEnabled();
152        case (INFO_INT):
153            return isInfoEnabled();
154        case (WARN_INT):
155            return isWarnEnabled();
156        case (ERROR_INT):
157            return isErrorEnabled();
158        default:
159            throw new IllegalArgumentException("Level [" + level + "] not recognized.");
160        }
161    }
162
163    /**
164     * Is the logger instance enabled for the TRACE level?
165     *
166     * @return True if this Logger is enabled for the TRACE level,
167     *         false otherwise.
168     * @since 1.4
169     */
170    public boolean isTraceEnabled();
171
172    /**
173     * Log a message at the TRACE level.
174     *
175     * @param msg the message string to be logged
176     * @since 1.4
177     */
178    public void trace(String msg);
179
180    /**
181     * Log a message at the TRACE level according to the specified format
182     * and argument.
183     * 
184     * <p>This form avoids superfluous object creation when the logger
185     * is disabled for the TRACE level. 
186     *
187     * @param format the format string
188     * @param arg    the argument
189     * @since 1.4
190     */
191    public void trace(String format, Object arg);
192
193    /**
194     * Log a message at the TRACE level according to the specified format
195     * and arguments.
196     * 
197     * <p>This form avoids superfluous object creation when the logger
198     * is disabled for the TRACE level. 
199     *
200     * @param format the format string
201     * @param arg1   the first argument
202     * @param arg2   the second argument
203     * @since 1.4
204     */
205    public void trace(String format, Object arg1, Object arg2);
206
207    /**
208     * Log a message at the TRACE level according to the specified format
209     * and arguments.
210     * 
211     * <p>This form avoids superfluous string concatenation when the logger
212     * is disabled for the TRACE level. However, this variant incurs the hidden
213     * (and relatively small) cost of creating an <code>Object[]</code> before invoking the method,
214     * even if this logger is disabled for TRACE. The variants taking {@link #trace(String, Object) one} and
215     * {@link #trace(String, Object, Object) two} arguments exist solely in order to avoid this hidden cost.
216     *
217     * @param format    the format string
218     * @param arguments a list of 3 or more arguments
219     * @since 1.4
220     */
221    public void trace(String format, Object... arguments);
222
223    /**
224     * Log an exception (throwable) at the TRACE level with an
225     * accompanying message.
226     *
227     * @param msg the message accompanying the exception
228     * @param t   the exception (throwable) to log
229     * @since 1.4
230     */
231    public void trace(String msg, Throwable t);
232
233    /**
234     * Similar to {@link #isTraceEnabled()} method except that the
235     * marker data is also taken into account.
236     *
237     * @param marker The marker data to take into consideration
238     * @return True if this Logger is enabled for the TRACE level,
239     *         false otherwise.
240     *         
241     * @since 1.4
242     */
243    public boolean isTraceEnabled(Marker marker);
244
245    /**
246     * Entry point for fluent-logging for {@link org.slf4j.event.Level#TRACE} level. 
247     *  
248     * @return LoggingEventBuilder instance as appropriate for level TRACE
249     * @since 2.0
250     */
251    @CheckReturnValue
252    default public LoggingEventBuilder atTrace() {
253        if (isTraceEnabled()) {
254            return makeLoggingEventBuilder(TRACE);
255        } else {
256            return NOPLoggingEventBuilder.singleton();
257        }
258    }
259
260    /**
261     * Log a message with the specific Marker at the TRACE level.
262     *
263     * @param marker the marker data specific to this log statement
264     * @param msg    the message string to be logged
265     * @since 1.4
266     */
267    public void trace(Marker marker, String msg);
268
269    /**
270     * This method is similar to {@link #trace(String, Object)} method except that the
271     * marker data is also taken into consideration.
272     *
273     * @param marker the marker data specific to this log statement
274     * @param format the format string
275     * @param arg    the argument
276     * @since 1.4
277     */
278    public void trace(Marker marker, String format, Object arg);
279
280    /**
281     * This method is similar to {@link #trace(String, Object, Object)}
282     * method except that the marker data is also taken into
283     * consideration.
284     *
285     * @param marker the marker data specific to this log statement
286     * @param format the format string
287     * @param arg1   the first argument
288     * @param arg2   the second argument
289     * @since 1.4
290     */
291    public void trace(Marker marker, String format, Object arg1, Object arg2);
292
293    /**
294     * This method is similar to {@link #trace(String, Object...)}
295     * method except that the marker data is also taken into
296     * consideration.
297     *
298     * @param marker   the marker data specific to this log statement
299     * @param format   the format string
300     * @param argArray an array of arguments
301     * @since 1.4
302     */
303    public void trace(Marker marker, String format, Object... argArray);
304
305    /**
306     * This method is similar to {@link #trace(String, Throwable)} method except that the
307     * marker data is also taken into consideration.
308     *
309     * @param marker the marker data specific to this log statement
310     * @param msg    the message accompanying the exception
311     * @param t      the exception (throwable) to log
312     * @since 1.4
313     */
314    public void trace(Marker marker, String msg, Throwable t);
315
316    /**
317     * Is the logger instance enabled for the DEBUG level?
318     *
319     * @return True if this Logger is enabled for the DEBUG level,
320     *         false otherwise.
321     */
322    public boolean isDebugEnabled();
323
324    /**
325     * Log a message at the DEBUG level.
326     *
327     * @param msg the message string to be logged
328     */
329    public void debug(String msg);
330
331    /**
332     * Log a message at the DEBUG level according to the specified format
333     * and argument.
334     * 
335     * <p>This form avoids superfluous object creation when the logger
336     * is disabled for the DEBUG level. 
337     *
338     * @param format the format string
339     * @param arg    the argument
340     */
341    public void debug(String format, Object arg);
342
343    /**
344     * Log a message at the DEBUG level according to the specified format
345     * and arguments.
346     * 
347     * <p>This form avoids superfluous object creation when the logger
348     * is disabled for the DEBUG level. 
349     *
350     * @param format the format string
351     * @param arg1   the first argument
352     * @param arg2   the second argument
353     */
354    public void debug(String format, Object arg1, Object arg2);
355
356    /**
357     * Log a message at the DEBUG level according to the specified format
358     * and arguments.
359     * 
360     * <p>This form avoids superfluous string concatenation when the logger
361     * is disabled for the DEBUG level. However, this variant incurs the hidden
362     * (and relatively small) cost of creating an <code>Object[]</code> before invoking the method,
363     * even if this logger is disabled for DEBUG. The variants taking
364     * {@link #debug(String, Object) one} and {@link #debug(String, Object, Object) two}
365     * arguments exist solely in order to avoid this hidden cost.
366     *
367     * @param format    the format string
368     * @param arguments a list of 3 or more arguments
369     */
370    public void debug(String format, Object... arguments);
371
372    /**
373     * Log an exception (throwable) at the DEBUG level with an
374     * accompanying message.
375     *
376     * @param msg the message accompanying the exception
377     * @param t   the exception (throwable) to log
378     */
379    public void debug(String msg, Throwable t);
380
381    /**
382     * Similar to {@link #isDebugEnabled()} method except that the
383     * marker data is also taken into account.
384     *
385     * @param marker The marker data to take into consideration
386     * @return True if this Logger is enabled for the DEBUG level,
387     *         false otherwise. 
388     */
389    public boolean isDebugEnabled(Marker marker);
390
391    /**
392     * Log a message with the specific Marker at the DEBUG level.
393     *
394     * @param marker the marker data specific to this log statement
395     * @param msg    the message string to be logged
396     */
397    public void debug(Marker marker, String msg);
398
399    /**
400     * This method is similar to {@link #debug(String, Object)} method except that the
401     * marker data is also taken into consideration.
402     *
403     * @param marker the marker data specific to this log statement
404     * @param format the format string
405     * @param arg    the argument
406     */
407    public void debug(Marker marker, String format, Object arg);
408
409    /**
410     * This method is similar to {@link #debug(String, Object, Object)}
411     * method except that the marker data is also taken into
412     * consideration.
413     *
414     * @param marker the marker data specific to this log statement
415     * @param format the format string
416     * @param arg1   the first argument
417     * @param arg2   the second argument
418     */
419    public void debug(Marker marker, String format, Object arg1, Object arg2);
420
421    /**
422     * This method is similar to {@link #debug(String, Object...)}
423     * method except that the marker data is also taken into
424     * consideration.
425     *
426     * @param marker    the marker data specific to this log statement
427     * @param format    the format string
428     * @param arguments a list of 3 or more arguments
429     */
430    public void debug(Marker marker, String format, Object... arguments);
431
432    /**
433     * This method is similar to {@link #debug(String, Throwable)} method except that the
434     * marker data is also taken into consideration.
435     *
436     * @param marker the marker data specific to this log statement
437     * @param msg    the message accompanying the exception
438     * @param t      the exception (throwable) to log
439     */
440    public void debug(Marker marker, String msg, Throwable t);
441
442    /**
443     * Entry point for fluent-logging for {@link org.slf4j.event.Level#DEBUG} level. 
444     *  
445     * @return LoggingEventBuilder instance as appropriate for level DEBUG
446     * @since 2.0
447     */
448    @CheckReturnValue
449    default public LoggingEventBuilder atDebug() {
450        if (isDebugEnabled()) {
451            return makeLoggingEventBuilder(DEBUG);
452        } else {
453            return NOPLoggingEventBuilder.singleton();
454        }
455    }
456
457    /**
458     * Is the logger instance enabled for the INFO level?
459     *
460     * @return True if this Logger is enabled for the INFO level,
461     *         false otherwise.
462     */
463    public boolean isInfoEnabled();
464
465    /**
466     * Log a message at the INFO level.
467     *
468     * @param msg the message string to be logged
469     */
470    public void info(String msg);
471
472    /**
473     * Log a message at the INFO level according to the specified format
474     * and argument.
475     * 
476     * <p>This form avoids superfluous object creation when the logger
477     * is disabled for the INFO level. 
478     *
479     * @param format the format string
480     * @param arg    the argument
481     */
482    public void info(String format, Object arg);
483
484    /**
485     * Log a message at the INFO level according to the specified format
486     * and arguments.
487     * 
488     * <p>This form avoids superfluous object creation when the logger
489     * is disabled for the INFO level. 
490     *
491     * @param format the format string
492     * @param arg1   the first argument
493     * @param arg2   the second argument
494     */
495    public void info(String format, Object arg1, Object arg2);
496
497    /**
498     * Log a message at the INFO level according to the specified format
499     * and arguments.
500     * 
501     * <p>This form avoids superfluous string concatenation when the logger
502     * is disabled for the INFO level. However, this variant incurs the hidden
503     * (and relatively small) cost of creating an <code>Object[]</code> before invoking the method,
504     * even if this logger is disabled for INFO. The variants taking
505     * {@link #info(String, Object) one} and {@link #info(String, Object, Object) two}
506     * arguments exist solely in order to avoid this hidden cost.
507     *
508     * @param format    the format string
509     * @param arguments a list of 3 or more arguments
510     */
511    public void info(String format, Object... arguments);
512
513    /**
514     * Log an exception (throwable) at the INFO level with an
515     * accompanying message.
516     *
517     * @param msg the message accompanying the exception
518     * @param t   the exception (throwable) to log
519     */
520    public void info(String msg, Throwable t);
521
522    /**
523     * Similar to {@link #isInfoEnabled()} method except that the marker
524     * data is also taken into consideration.
525     *
526     * @param marker The marker data to take into consideration
527     * @return true if this Logger is enabled for the INFO level,
528     *         false otherwise.
529     */
530    public boolean isInfoEnabled(Marker marker);
531
532    /**
533     * Log a message with the specific Marker at the INFO level.
534     *
535     * @param marker The marker specific to this log statement
536     * @param msg    the message string to be logged
537     */
538    public void info(Marker marker, String msg);
539
540    /**
541     * This method is similar to {@link #info(String, Object)} method except that the
542     * marker data is also taken into consideration.
543     *
544     * @param marker the marker data specific to this log statement
545     * @param format the format string
546     * @param arg    the argument
547     */
548    public void info(Marker marker, String format, Object arg);
549
550    /**
551     * This method is similar to {@link #info(String, Object, Object)}
552     * method except that the marker data is also taken into
553     * consideration.
554     *
555     * @param marker the marker data specific to this log statement
556     * @param format the format string
557     * @param arg1   the first argument
558     * @param arg2   the second argument
559     */
560    public void info(Marker marker, String format, Object arg1, Object arg2);
561
562    /**
563     * This method is similar to {@link #info(String, Object...)}
564     * method except that the marker data is also taken into
565     * consideration.
566     *
567     * @param marker    the marker data specific to this log statement
568     * @param format    the format string
569     * @param arguments a list of 3 or more arguments
570     */
571    public void info(Marker marker, String format, Object... arguments);
572
573    /**
574     * This method is similar to {@link #info(String, Throwable)} method
575     * except that the marker data is also taken into consideration.
576     *
577     * @param marker the marker data for this log statement
578     * @param msg    the message accompanying the exception
579     * @param t      the exception (throwable) to log
580     */
581    public void info(Marker marker, String msg, Throwable t);
582
583    /**
584     * Entry point for fluent-logging for {@link org.slf4j.event.Level#INFO} level. 
585     *  
586     * @return LoggingEventBuilder instance as appropriate for level INFO
587     * @since 2.0
588     */
589    @CheckReturnValue
590    default public LoggingEventBuilder atInfo() {
591        if (isInfoEnabled()) {
592            return makeLoggingEventBuilder(INFO);
593        } else {
594            return NOPLoggingEventBuilder.singleton();
595        }
596    }
597
598    /**
599     * Is the logger instance enabled for the WARN level?
600     *
601     * @return True if this Logger is enabled for the WARN level,
602     *         false otherwise.
603     */
604    public boolean isWarnEnabled();
605
606    /**
607     * Log a message at the WARN level.
608     *
609     * @param msg the message string to be logged
610     */
611    public void warn(String msg);
612
613    /**
614     * Log a message at the WARN level according to the specified format
615     * and argument.
616     * 
617     * <p>This form avoids superfluous object creation when the logger
618     * is disabled for the WARN level. 
619     *
620     * @param format the format string
621     * @param arg    the argument
622     */
623    public void warn(String format, Object arg);
624
625    /**
626     * Log a message at the WARN level according to the specified format
627     * and arguments.
628     * 
629     * <p>This form avoids superfluous string concatenation when the logger
630     * is disabled for the WARN level. However, this variant incurs the hidden
631     * (and relatively small) cost of creating an <code>Object[]</code> before invoking the method,
632     * even if this logger is disabled for WARN. The variants taking
633     * {@link #warn(String, Object) one} and {@link #warn(String, Object, Object) two}
634     * arguments exist solely in order to avoid this hidden cost.
635     *
636     * @param format    the format string
637     * @param arguments a list of 3 or more arguments
638     */
639    public void warn(String format, Object... arguments);
640
641    /**
642     * Log a message at the WARN level according to the specified format
643     * and arguments.
644     * 
645     * <p>This form avoids superfluous object creation when the logger
646     * is disabled for the WARN level. 
647     *
648     * @param format the format string
649     * @param arg1   the first argument
650     * @param arg2   the second argument
651     */
652    public void warn(String format, Object arg1, Object arg2);
653
654    /**
655     * Log an exception (throwable) at the WARN level with an
656     * accompanying message.
657     *
658     * @param msg the message accompanying the exception
659     * @param t   the exception (throwable) to log
660     */
661    public void warn(String msg, Throwable t);
662
663    /**
664     * Similar to {@link #isWarnEnabled()} method except that the marker
665     * data is also taken into consideration.
666     *
667     * @param marker The marker data to take into consideration
668     * @return True if this Logger is enabled for the WARN level,
669     *         false otherwise.
670     */
671    public boolean isWarnEnabled(Marker marker);
672
673    /**
674     * Log a message with the specific Marker at the WARN level.
675     *
676     * @param marker The marker specific to this log statement
677     * @param msg    the message string to be logged
678     */
679    public void warn(Marker marker, String msg);
680
681    /**
682     * This method is similar to {@link #warn(String, Object)} method except that the
683     * marker data is also taken into consideration.
684     *
685     * @param marker the marker data specific to this log statement
686     * @param format the format string
687     * @param arg    the argument
688     */
689    public void warn(Marker marker, String format, Object arg);
690
691    /**
692     * This method is similar to {@link #warn(String, Object, Object)}
693     * method except that the marker data is also taken into
694     * consideration.
695     *
696     * @param marker the marker data specific to this log statement
697     * @param format the format string
698     * @param arg1   the first argument
699     * @param arg2   the second argument
700     */
701    public void warn(Marker marker, String format, Object arg1, Object arg2);
702
703    /**
704     * This method is similar to {@link #warn(String, Object...)}
705     * method except that the marker data is also taken into
706     * consideration.
707     *
708     * @param marker    the marker data specific to this log statement
709     * @param format    the format string
710     * @param arguments a list of 3 or more arguments
711     */
712    public void warn(Marker marker, String format, Object... arguments);
713
714    /**
715     * This method is similar to {@link #warn(String, Throwable)} method
716     * except that the marker data is also taken into consideration.
717     *
718     * @param marker the marker data for this log statement
719     * @param msg    the message accompanying the exception
720     * @param t      the exception (throwable) to log
721     */
722    public void warn(Marker marker, String msg, Throwable t);
723
724    /**
725     * Entry point for fluent-logging for {@link org.slf4j.event.Level#WARN} level. 
726     *  
727     * @return LoggingEventBuilder instance as appropriate for level WARN
728     * @since 2.0
729     */
730    @CheckReturnValue
731    default public LoggingEventBuilder atWarn() {
732        if (isWarnEnabled()) {
733            return makeLoggingEventBuilder(WARN);
734        } else {
735            return NOPLoggingEventBuilder.singleton();
736        }
737    }
738
739    /**
740     * Is the logger instance enabled for the ERROR level?
741     *
742     * @return True if this Logger is enabled for the ERROR level,
743     *         false otherwise.
744     */
745    public boolean isErrorEnabled();
746
747    /**
748     * Log a message at the ERROR level.
749     *
750     * @param msg the message string to be logged
751     */
752    public void error(String msg);
753
754    /**
755     * Log a message at the ERROR level according to the specified format
756     * and argument.
757     * 
758     * <p>This form avoids superfluous object creation when the logger
759     * is disabled for the ERROR level. 
760     *
761     * @param format the format string
762     * @param arg    the argument
763     */
764    public void error(String format, Object arg);
765
766    /**
767     * Log a message at the ERROR level according to the specified format
768     * and arguments.
769     * 
770     * <p>This form avoids superfluous object creation when the logger
771     * is disabled for the ERROR level. 
772     *
773     * @param format the format string
774     * @param arg1   the first argument
775     * @param arg2   the second argument
776     */
777    public void error(String format, Object arg1, Object arg2);
778
779    /**
780     * Log a message at the ERROR level according to the specified format
781     * and arguments.
782     * 
783     * <p>This form avoids superfluous string concatenation when the logger
784     * is disabled for the ERROR level. However, this variant incurs the hidden
785     * (and relatively small) cost of creating an <code>Object[]</code> before invoking the method,
786     * even if this logger is disabled for ERROR. The variants taking
787     * {@link #error(String, Object) one} and {@link #error(String, Object, Object) two}
788     * arguments exist solely in order to avoid this hidden cost.
789     *
790     * @param format    the format string
791     * @param arguments a list of 3 or more arguments
792     */
793    public void error(String format, Object... arguments);
794
795    /**
796     * Log an exception (throwable) at the ERROR level with an
797     * accompanying message.
798     *
799     * @param msg the message accompanying the exception
800     * @param t   the exception (throwable) to log
801     */
802    public void error(String msg, Throwable t);
803
804    /**
805     * Similar to {@link #isErrorEnabled()} method except that the
806     * marker data is also taken into consideration.
807     *
808     * @param marker The marker data to take into consideration
809     * @return True if this Logger is enabled for the ERROR level,
810     *         false otherwise.
811     */
812    public boolean isErrorEnabled(Marker marker);
813
814    /**
815     * Log a message with the specific Marker at the ERROR level.
816     *
817     * @param marker The marker specific to this log statement
818     * @param msg    the message string to be logged
819     */
820    public void error(Marker marker, String msg);
821
822    /**
823     * This method is similar to {@link #error(String, Object)} method except that the
824     * marker data is also taken into consideration.
825     *
826     * @param marker the marker data specific to this log statement
827     * @param format the format string
828     * @param arg    the argument
829     */
830    public void error(Marker marker, String format, Object arg);
831
832    /**
833     * This method is similar to {@link #error(String, Object, Object)}
834     * method except that the marker data is also taken into
835     * consideration.
836     *
837     * @param marker the marker data specific to this log statement
838     * @param format the format string
839     * @param arg1   the first argument
840     * @param arg2   the second argument
841     */
842    public void error(Marker marker, String format, Object arg1, Object arg2);
843
844    /**
845     * This method is similar to {@link #error(String, Object...)}
846     * method except that the marker data is also taken into
847     * consideration.
848     *
849     * @param marker    the marker data specific to this log statement
850     * @param format    the format string
851     * @param arguments a list of 3 or more arguments
852     */
853    public void error(Marker marker, String format, Object... arguments);
854
855    /**
856     * This method is similar to {@link #error(String, Throwable)}
857     * method except that the marker data is also taken into
858     * consideration.
859     *
860     * @param marker the marker data specific to this log statement
861     * @param msg    the message accompanying the exception
862     * @param t      the exception (throwable) to log
863     */
864    public void error(Marker marker, String msg, Throwable t);
865
866    /**
867     * Entry point for fluent-logging for {@link org.slf4j.event.Level#ERROR} level. 
868     *  
869     * @return LoggingEventBuilder instance as appropriate for level ERROR
870     * @since 2.0
871     */
872    @CheckReturnValue
873    default public LoggingEventBuilder atError() {
874        if (isErrorEnabled()) {
875            return makeLoggingEventBuilder(ERROR);
876        } else {
877            return NOPLoggingEventBuilder.singleton();
878        }
879    }
880
881}