001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache license, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the license for the specific language governing permissions and
015 * limitations under the license.
016 */
017package org.apache.logging.log4j.spi;
018
019import java.io.Serializable;
020
021import org.apache.logging.log4j.Level;
022import org.apache.logging.log4j.LoggingException;
023import org.apache.logging.log4j.Marker;
024import org.apache.logging.log4j.MarkerManager;
025import org.apache.logging.log4j.message.DefaultFlowMessageFactory;
026import org.apache.logging.log4j.message.EntryMessage;
027import org.apache.logging.log4j.message.FlowMessageFactory;
028import org.apache.logging.log4j.message.Message;
029import org.apache.logging.log4j.message.MessageFactory;
030import org.apache.logging.log4j.message.MessageFactory2;
031import org.apache.logging.log4j.message.ParameterizedMessage;
032import org.apache.logging.log4j.message.ParameterizedMessageFactory;
033import org.apache.logging.log4j.message.ReusableMessageFactory;
034import org.apache.logging.log4j.message.SimpleMessage;
035import org.apache.logging.log4j.message.StringFormattedMessage;
036import org.apache.logging.log4j.status.StatusLogger;
037import org.apache.logging.log4j.util.Constants;
038import org.apache.logging.log4j.util.LambdaUtil;
039import org.apache.logging.log4j.util.LoaderUtil;
040import org.apache.logging.log4j.util.MessageSupplier;
041import org.apache.logging.log4j.util.PerformanceSensitive;
042import org.apache.logging.log4j.util.PropertiesUtil;
043import org.apache.logging.log4j.util.Strings;
044import org.apache.logging.log4j.util.Supplier;
045
046/**
047 * Base implementation of a Logger. It is highly recommended that any Logger implementation extend this class.
048 */
049public abstract class AbstractLogger implements ExtendedLogger, Serializable {
050    // Implementation note: many methods in this class are tuned for performance. MODIFY WITH CARE!
051    // Specifically, try to keep the hot methods to 35 bytecodes or less:
052    // this is within the MaxInlineSize threshold and makes these methods candidates for
053    // immediate inlining instead of waiting until they are designated "hot enough".
054
055    /**
056     * Marker for flow tracing.
057     */
058    public static final Marker FLOW_MARKER = MarkerManager.getMarker("FLOW");
059
060    /**
061     * Marker for method entry tracing.
062     */
063    public static final Marker ENTRY_MARKER = MarkerManager.getMarker("ENTER").setParents(FLOW_MARKER);
064
065    /**
066     * Marker for method exit tracing.
067     */
068    public static final Marker EXIT_MARKER = MarkerManager.getMarker("EXIT").setParents(FLOW_MARKER);
069
070    /**
071     * Marker for exception tracing.
072     */
073    public static final Marker EXCEPTION_MARKER = MarkerManager.getMarker("EXCEPTION");
074
075    /**
076     * Marker for throwing exceptions.
077     */
078    public static final Marker THROWING_MARKER = MarkerManager.getMarker("THROWING").setParents(EXCEPTION_MARKER);
079
080    /**
081     * Marker for catching exceptions.
082     */
083    public static final Marker CATCHING_MARKER = MarkerManager.getMarker("CATCHING").setParents(EXCEPTION_MARKER);
084
085    /**
086     * The default MessageFactory class.
087     */
088    public static final Class<? extends MessageFactory> DEFAULT_MESSAGE_FACTORY_CLASS =
089            createClassForProperty("log4j2.messageFactory", ReusableMessageFactory.class,
090                    ParameterizedMessageFactory.class);
091
092    /**
093     * The default FlowMessageFactory class.
094     */
095    public static final Class<? extends FlowMessageFactory> DEFAULT_FLOW_MESSAGE_FACTORY_CLASS =
096            createFlowClassForProperty("log4j2.flowMessageFactory", DefaultFlowMessageFactory.class);
097
098    private static final long serialVersionUID = 2L;
099
100    private static final String FQCN = AbstractLogger.class.getName();
101    private static final String THROWING = "Throwing";
102    private static final String CATCHING = "Catching";
103
104    protected final String name;
105    private final MessageFactory2 messageFactory;
106    private final FlowMessageFactory flowMessageFactory;
107
108    /**
109     * Creates a new logger named after this class (or subclass).
110     */
111    public AbstractLogger() {
112        this.name = getClass().getName();
113        this.messageFactory = createDefaultMessageFactory();
114        this.flowMessageFactory = createDefaultFlowMessageFactory();
115    }
116
117    /**
118     * Creates a new named logger.
119     *
120     * @param name the logger name
121     */
122    public AbstractLogger(final String name) {
123        this(name, createDefaultMessageFactory());
124    }
125
126    /**
127     * Creates a new named logger with a particular {@link MessageFactory}.
128     *
129     * @param name the logger name
130     * @param messageFactory the message factory, if null then use the default message factory.
131     */
132    public AbstractLogger(final String name, final MessageFactory messageFactory) {
133        this.name = name;
134        this.messageFactory = messageFactory == null ? createDefaultMessageFactory() : narrow(messageFactory);
135        this.flowMessageFactory = createDefaultFlowMessageFactory();
136    }
137
138    /**
139     * Checks that the message factory a logger was created with is the same as the given messageFactory. If they are
140     * different log a warning to the {@linkplain StatusLogger}. A null MessageFactory translates to the default
141     * MessageFactory {@link #DEFAULT_MESSAGE_FACTORY_CLASS}.
142     *
143     * @param logger The logger to check
144     * @param messageFactory The message factory to check.
145     */
146    public static void checkMessageFactory(final ExtendedLogger logger, final MessageFactory messageFactory) {
147        final String name = logger.getName();
148        final MessageFactory loggerMessageFactory = logger.getMessageFactory();
149        if (messageFactory != null && !loggerMessageFactory.equals(messageFactory)) {
150            StatusLogger.getLogger().warn(
151                    "The Logger {} was created with the message factory {} and is now requested with the "
152                            + "message factory {}, which may create log events with unexpected formatting.", name,
153                    loggerMessageFactory, messageFactory);
154        } else if (messageFactory == null && !loggerMessageFactory.getClass().equals(DEFAULT_MESSAGE_FACTORY_CLASS)) {
155            StatusLogger
156                    .getLogger()
157                    .warn("The Logger {} was created with the message factory {} and is now requested with a null "
158                            + "message factory (defaults to {}), which may create log events with unexpected "
159                            + "formatting.",
160                            name, loggerMessageFactory, DEFAULT_MESSAGE_FACTORY_CLASS.getName());
161        }
162    }
163
164    @Override
165    public void catching(final Level level, final Throwable t) {
166        catching(FQCN, level, t);
167    }
168
169    /**
170     * Logs a Throwable that has been caught with location information.
171     *
172     * @param fqcn The fully qualified class name of the <b>caller</b>.
173     * @param level The logging level.
174     * @param t The Throwable.
175     */
176    protected void catching(final String fqcn, final Level level, final Throwable t) {
177        if (isEnabled(level, CATCHING_MARKER, (Object) null, null)) {
178            logMessageSafely(fqcn, level, CATCHING_MARKER, catchingMsg(t), t);
179        }
180    }
181
182    @Override
183    public void catching(final Throwable t) {
184        if (isEnabled(Level.ERROR, CATCHING_MARKER, (Object) null, null)) {
185            logMessageSafely(FQCN, Level.ERROR, CATCHING_MARKER, catchingMsg(t), t);
186        }
187    }
188
189    protected Message catchingMsg(final Throwable t) {
190        return messageFactory.newMessage(CATCHING);
191    }
192
193    private static Class<? extends MessageFactory> createClassForProperty(final String property,
194            final Class<ReusableMessageFactory> reusableParameterizedMessageFactoryClass,
195            final Class<ParameterizedMessageFactory> parameterizedMessageFactoryClass) {
196        try {
197            final String fallback = Constants.ENABLE_THREADLOCALS ? reusableParameterizedMessageFactoryClass.getName()
198                    : parameterizedMessageFactoryClass.getName();
199            final String clsName = PropertiesUtil.getProperties().getStringProperty(property, fallback);
200            return LoaderUtil.loadClass(clsName).asSubclass(MessageFactory.class);
201        } catch (final Throwable t) {
202            return parameterizedMessageFactoryClass;
203        }
204    }
205
206    private static Class<? extends FlowMessageFactory> createFlowClassForProperty(final String property,
207            final Class<DefaultFlowMessageFactory> defaultFlowMessageFactoryClass) {
208        try {
209            final String clsName = PropertiesUtil.getProperties().getStringProperty(property, defaultFlowMessageFactoryClass.getName());
210            return LoaderUtil.loadClass(clsName).asSubclass(FlowMessageFactory.class);
211        } catch (final Throwable t) {
212            return defaultFlowMessageFactoryClass;
213        }
214    }
215
216    private static MessageFactory2 createDefaultMessageFactory() {
217        try {
218            final MessageFactory result = DEFAULT_MESSAGE_FACTORY_CLASS.newInstance();
219            return narrow(result);
220        } catch (final InstantiationException | IllegalAccessException e) {
221            throw new IllegalStateException(e);
222        }
223    }
224
225    private static MessageFactory2 narrow(final MessageFactory result) {
226        if (result instanceof MessageFactory2) {
227            return (MessageFactory2) result;
228        }
229        return new MessageFactory2Adapter(result);
230    }
231
232    private static FlowMessageFactory createDefaultFlowMessageFactory() {
233        try {
234            return DEFAULT_FLOW_MESSAGE_FACTORY_CLASS.newInstance();
235        } catch (final InstantiationException | IllegalAccessException e) {
236            throw new IllegalStateException(e);
237        }
238    }
239
240    @Override
241    public void debug(final Marker marker, final CharSequence message) {
242        logIfEnabled(FQCN, Level.DEBUG, marker, message, null);
243    }
244
245    @Override
246    public void debug(final Marker marker, final CharSequence message, final Throwable t) {
247        logIfEnabled(FQCN, Level.DEBUG, marker, message, t);
248    }
249
250    @Override
251    public void debug(final Marker marker, final Message msg) {
252        logIfEnabled(FQCN, Level.DEBUG, marker, msg, msg != null ? msg.getThrowable() : null);
253    }
254
255    @Override
256    public void debug(final Marker marker, final Message msg, final Throwable t) {
257        logIfEnabled(FQCN, Level.DEBUG, marker, msg, t);
258    }
259
260    @Override
261    public void debug(final Marker marker, final Object message) {
262        logIfEnabled(FQCN, Level.DEBUG, marker, message, null);
263    }
264
265    @Override
266    public void debug(final Marker marker, final Object message, final Throwable t) {
267        logIfEnabled(FQCN, Level.DEBUG, marker, message, t);
268    }
269
270    @Override
271    public void debug(final Marker marker, final String message) {
272        logIfEnabled(FQCN, Level.DEBUG, marker, message, (Throwable) null);
273    }
274
275    @Override
276    public void debug(final Marker marker, final String message, final Object... params) {
277        logIfEnabled(FQCN, Level.DEBUG, marker, message, params);
278    }
279
280    @Override
281    public void debug(final Marker marker, final String message, final Throwable t) {
282        logIfEnabled(FQCN, Level.DEBUG, marker, message, t);
283    }
284
285    @Override
286    public void debug(final Message msg) {
287        logIfEnabled(FQCN, Level.DEBUG, null, msg, msg != null ? msg.getThrowable() : null);
288    }
289
290    @Override
291    public void debug(final Message msg, final Throwable t) {
292        logIfEnabled(FQCN, Level.DEBUG, null, msg, t);
293    }
294
295    @Override
296    public void debug(final CharSequence message) {
297        logIfEnabled(FQCN, Level.DEBUG, null, message, null);
298    }
299
300    @Override
301    public void debug(final CharSequence message, final Throwable t) {
302        logIfEnabled(FQCN, Level.DEBUG, null, message, t);
303    }
304
305    @Override
306    public void debug(final Object message) {
307        logIfEnabled(FQCN, Level.DEBUG, null, message, null);
308    }
309
310    @Override
311    public void debug(final Object message, final Throwable t) {
312        logIfEnabled(FQCN, Level.DEBUG, null, message, t);
313    }
314
315    @Override
316    public void debug(final String message) {
317        logIfEnabled(FQCN, Level.DEBUG, null, message, (Throwable) null);
318    }
319
320    @Override
321    public void debug(final String message, final Object... params) {
322        logIfEnabled(FQCN, Level.DEBUG, null, message, params);
323    }
324
325    @Override
326    public void debug(final String message, final Throwable t) {
327        logIfEnabled(FQCN, Level.DEBUG, null, message, t);
328    }
329
330    @Override
331    public void debug(final Supplier<?> msgSupplier) {
332        logIfEnabled(FQCN, Level.DEBUG, null, msgSupplier, (Throwable) null);
333    }
334
335    @Override
336    public void debug(final Supplier<?> msgSupplier, final Throwable t) {
337        logIfEnabled(FQCN, Level.DEBUG, null, msgSupplier, t);
338    }
339
340    @Override
341    public void debug(final Marker marker, final Supplier<?> msgSupplier) {
342        logIfEnabled(FQCN, Level.DEBUG, marker, msgSupplier, (Throwable) null);
343    }
344
345    @Override
346    public void debug(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
347        logIfEnabled(FQCN, Level.DEBUG, marker, message, paramSuppliers);
348    }
349
350    @Override
351    public void debug(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
352        logIfEnabled(FQCN, Level.DEBUG, marker, msgSupplier, t);
353    }
354
355    @Override
356    public void debug(final String message, final Supplier<?>... paramSuppliers) {
357        logIfEnabled(FQCN, Level.DEBUG, null, message, paramSuppliers);
358    }
359
360    @Override
361    public void debug(final Marker marker, final MessageSupplier msgSupplier) {
362        logIfEnabled(FQCN, Level.DEBUG, marker, msgSupplier, (Throwable) null);
363    }
364
365    @Override
366    public void debug(final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
367        logIfEnabled(FQCN, Level.DEBUG, marker, msgSupplier, t);
368    }
369
370    @Override
371    public void debug(final MessageSupplier msgSupplier) {
372        logIfEnabled(FQCN, Level.DEBUG, null, msgSupplier, (Throwable) null);
373    }
374
375    @Override
376    public void debug(final MessageSupplier msgSupplier, final Throwable t) {
377        logIfEnabled(FQCN, Level.DEBUG, null, msgSupplier, t);
378    }
379
380    @Override
381    public void debug(final Marker marker, final String message, final Object p0) {
382        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0);
383    }
384
385    @Override
386    public void debug(final Marker marker, final String message, final Object p0, final Object p1) {
387        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1);
388    }
389
390    @Override
391    public void debug(final Marker marker, final String message, final Object p0, final Object p1, final Object p2) {
392        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1, p2);
393    }
394
395    @Override
396    public void debug(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
397            final Object p3) {
398        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1, p2, p3);
399    }
400
401    @Override
402    public void debug(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
403            final Object p3, final Object p4) {
404        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1, p2, p3, p4);
405    }
406
407    @Override
408    public void debug(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
409            final Object p3, final Object p4, final Object p5) {
410        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1, p2, p3, p4, p5);
411    }
412
413    @Override
414    public void debug(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
415            final Object p3, final Object p4, final Object p5,
416            final Object p6) {
417        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1, p2, p3, p4, p5, p6);
418    }
419
420    @Override
421    public void debug(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
422            final Object p3, final Object p4, final Object p5,
423            final Object p6, final Object p7) {
424        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
425    }
426
427    @Override
428    public void debug(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
429            final Object p3, final Object p4, final Object p5,
430            final Object p6, final Object p7, final Object p8) {
431        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
432    }
433
434    @Override
435    public void debug(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
436            final Object p3, final Object p4, final Object p5,
437            final Object p6, final Object p7, final Object p8, final Object p9) {
438        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
439    }
440
441    @Override
442    public void debug(final String message, final Object p0) {
443        logIfEnabled(FQCN, Level.DEBUG, null, message, p0);
444    }
445
446    @Override
447    public void debug(final String message, final Object p0, final Object p1) {
448        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1);
449    }
450
451    @Override
452    public void debug(final String message, final Object p0, final Object p1, final Object p2) {
453        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1, p2);
454    }
455
456    @Override
457    public void debug(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
458        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1, p2, p3);
459    }
460
461    @Override
462    public void debug(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
463            final Object p4) {
464        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1, p2, p3, p4);
465    }
466
467    @Override
468    public void debug(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
469            final Object p4, final Object p5) {
470        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1, p2, p3, p4, p5);
471    }
472
473    @Override
474    public void debug(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
475            final Object p4, final Object p5, final Object p6) {
476        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1, p2, p3, p4, p5, p6);
477    }
478
479    @Override
480    public void debug(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
481            final Object p4, final Object p5, final Object p6,
482            final Object p7) {
483        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
484    }
485
486    @Override
487    public void debug(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
488            final Object p4, final Object p5, final Object p6,
489            final Object p7, final Object p8) {
490        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
491    }
492
493    @Override
494    public void debug(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
495            final Object p4, final Object p5, final Object p6,
496            final Object p7, final Object p8, final Object p9) {
497        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
498    }
499
500    /**
501     * Logs entry to a method with location information.
502     *
503     * @param fqcn The fully qualified class name of the <b>caller</b>.
504     * @param format Format String for the parameters.
505     * @param paramSuppliers The Suppliers of the parameters.
506     */
507    protected EntryMessage enter(final String fqcn, final String format, final Supplier<?>... paramSuppliers) {
508        EntryMessage entryMsg = null;
509        if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
510            logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, entryMsg = entryMsg(format, paramSuppliers), null);
511        }
512        return entryMsg;
513    }
514
515    /**
516     * Logs entry to a method with location information.
517     *
518     * @param fqcn The fully qualified class name of the <b>caller</b>.
519     * @param format The format String for the parameters.
520     * @param paramSuppliers The parameters to the method.
521     */
522    @Deprecated
523    protected EntryMessage enter(final String fqcn, final String format, final MessageSupplier... paramSuppliers) {
524        EntryMessage entryMsg = null;
525        if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
526            logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, entryMsg = entryMsg(format, paramSuppliers), null);
527        }
528        return entryMsg;
529    }
530
531    /**
532     * Logs entry to a method with location information.
533     *
534     * @param fqcn The fully qualified class name of the <b>caller</b>.
535     * @param format The format String for the parameters.
536     * @param params The parameters to the method.
537     */
538    protected EntryMessage enter(final String fqcn, final String format, final Object... params) {
539        EntryMessage entryMsg = null;
540        if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
541            logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, entryMsg = entryMsg(format, params), null);
542        }
543        return entryMsg;
544    }
545
546    /**
547     * Logs entry to a method with location information.
548     *
549     * @param fqcn The fully qualified class name of the <b>caller</b>.
550     * @param msgSupplier The Supplier of the Message.
551     */
552    @Deprecated
553    protected EntryMessage enter(final String fqcn, final MessageSupplier msgSupplier) {
554        EntryMessage message = null;
555        if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
556            logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, message = flowMessageFactory.newEntryMessage(
557                    msgSupplier.get()), null);
558        }
559        return message;
560    }
561
562    /**
563     * Logs entry to a method with location information.
564     *
565     * @param fqcn
566     *            The fully qualified class name of the <b>caller</b>.
567     * @param message
568     *            the Message.
569     * @since 2.6
570     */
571    protected EntryMessage enter(final String fqcn, final Message message) {
572        EntryMessage flowMessage = null;
573        if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
574            logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, flowMessage = flowMessageFactory.newEntryMessage(message),
575                    null);
576        }
577        return flowMessage;
578    }
579
580    @Override
581    public void entry() {
582        entry(FQCN, (Object[]) null);
583    }
584
585    @Override
586    public void entry(final Object... params) {
587        entry(FQCN, params);
588    }
589
590    /**
591     * Logs entry to a method with location information.
592     *
593     * @param fqcn The fully qualified class name of the <b>caller</b>.
594     * @param params The parameters to the method.
595     */
596    protected void entry(final String fqcn, final Object... params) {
597        if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
598            if (params == null) {
599                logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, entryMsg(null, (Supplier<?>[]) null), null);
600            } else {
601                logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, entryMsg(null, params), null);
602            }
603        }
604    }
605
606    protected EntryMessage entryMsg(final String format, final Object... params) {
607        final int count = params == null ? 0 : params.length;
608        if (count == 0) {
609            if (Strings.isEmpty(format)) {
610                return flowMessageFactory.newEntryMessage(null);
611            }
612            return flowMessageFactory.newEntryMessage(new SimpleMessage(format));
613        }
614        if (format != null) {
615            return flowMessageFactory.newEntryMessage(new ParameterizedMessage(format, params));
616        }
617        final StringBuilder sb = new StringBuilder();
618        sb.append("params(");
619        for (int i = 0; i < count; i++) {
620            if (i > 0) {
621                sb.append(", ");
622            }
623            final Object parm = params[i];
624            sb.append(parm instanceof Message ? ((Message) parm).getFormattedMessage() : String.valueOf(parm));
625        }
626        sb.append(')');
627        return flowMessageFactory.newEntryMessage(new SimpleMessage(sb));
628    }
629
630    protected EntryMessage entryMsg(final String format, final MessageSupplier... paramSuppliers) {
631        final int count = paramSuppliers == null ? 0 : paramSuppliers.length;
632        final Object[] params = new Object[count];
633        for (int i = 0; i < count; i++) {
634            params[i] = paramSuppliers[i].get();
635            params[i] = params[i] != null ? ((Message) params[i]).getFormattedMessage() : null;
636        }
637        return entryMsg(format, params);
638    }
639
640    protected EntryMessage entryMsg(final String format, final Supplier<?>... paramSuppliers) {
641        final int count = paramSuppliers == null ? 0 : paramSuppliers.length;
642        final Object[] params = new Object[count];
643        for (int i = 0; i < count; i++) {
644            params[i] = paramSuppliers[i].get();
645            if (params[i] instanceof Message) {
646                params[i] = ((Message) params[i]).getFormattedMessage();
647            }
648        }
649        return entryMsg(format, params);
650    }
651
652    @Override
653    public void error(final Marker marker, final Message msg) {
654        logIfEnabled(FQCN, Level.ERROR, marker, msg, msg != null ? msg.getThrowable() : null);
655    }
656
657    @Override
658    public void error(final Marker marker, final Message msg, final Throwable t) {
659        logIfEnabled(FQCN, Level.ERROR, marker, msg, t);
660    }
661
662    @Override
663    public void error(final Marker marker, final CharSequence message) {
664        logIfEnabled(FQCN, Level.ERROR, marker, message, null);
665    }
666
667    @Override
668    public void error(final Marker marker, final CharSequence message, final Throwable t) {
669        logIfEnabled(FQCN, Level.ERROR, marker, message, t);
670    }
671
672    @Override
673    public void error(final Marker marker, final Object message) {
674        logIfEnabled(FQCN, Level.ERROR, marker, message, null);
675    }
676
677    @Override
678    public void error(final Marker marker, final Object message, final Throwable t) {
679        logIfEnabled(FQCN, Level.ERROR, marker, message, t);
680    }
681
682    @Override
683    public void error(final Marker marker, final String message) {
684        logIfEnabled(FQCN, Level.ERROR, marker, message, (Throwable) null);
685    }
686
687    @Override
688    public void error(final Marker marker, final String message, final Object... params) {
689        logIfEnabled(FQCN, Level.ERROR, marker, message, params);
690    }
691
692    @Override
693    public void error(final Marker marker, final String message, final Throwable t) {
694        logIfEnabled(FQCN, Level.ERROR, marker, message, t);
695    }
696
697    @Override
698    public void error(final Message msg) {
699        logIfEnabled(FQCN, Level.ERROR, null, msg, msg != null ? msg.getThrowable() : null);
700    }
701
702    @Override
703    public void error(final Message msg, final Throwable t) {
704        logIfEnabled(FQCN, Level.ERROR, null, msg, t);
705    }
706
707    @Override
708    public void error(final CharSequence message) {
709        logIfEnabled(FQCN, Level.ERROR, null, message, null);
710    }
711
712    @Override
713    public void error(final CharSequence message, final Throwable t) {
714        logIfEnabled(FQCN, Level.ERROR, null, message, t);
715    }
716
717    @Override
718    public void error(final Object message) {
719        logIfEnabled(FQCN, Level.ERROR, null, message, null);
720    }
721
722    @Override
723    public void error(final Object message, final Throwable t) {
724        logIfEnabled(FQCN, Level.ERROR, null, message, t);
725    }
726
727    @Override
728    public void error(final String message) {
729        logIfEnabled(FQCN, Level.ERROR, null, message, (Throwable) null);
730    }
731
732    @Override
733    public void error(final String message, final Object... params) {
734        logIfEnabled(FQCN, Level.ERROR, null, message, params);
735    }
736
737    @Override
738    public void error(final String message, final Throwable t) {
739        logIfEnabled(FQCN, Level.ERROR, null, message, t);
740    }
741
742    @Override
743    public void error(final Supplier<?> msgSupplier) {
744        logIfEnabled(FQCN, Level.ERROR, null, msgSupplier, (Throwable) null);
745    }
746
747    @Override
748    public void error(final Supplier<?> msgSupplier, final Throwable t) {
749        logIfEnabled(FQCN, Level.ERROR, null, msgSupplier, t);
750    }
751
752    @Override
753    public void error(final Marker marker, final Supplier<?> msgSupplier) {
754        logIfEnabled(FQCN, Level.ERROR, marker, msgSupplier, (Throwable) null);
755    }
756
757    @Override
758    public void error(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
759        logIfEnabled(FQCN, Level.ERROR, marker, message, paramSuppliers);
760    }
761
762    @Override
763    public void error(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
764        logIfEnabled(FQCN, Level.ERROR, marker, msgSupplier, t);
765    }
766
767    @Override
768    public void error(final String message, final Supplier<?>... paramSuppliers) {
769        logIfEnabled(FQCN, Level.ERROR, null, message, paramSuppliers);
770    }
771
772    @Override
773    public void error(final Marker marker, final MessageSupplier msgSupplier) {
774        logIfEnabled(FQCN, Level.ERROR, marker, msgSupplier, (Throwable) null);
775    }
776
777    @Override
778    public void error(final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
779        logIfEnabled(FQCN, Level.ERROR, marker, msgSupplier, t);
780    }
781
782    @Override
783    public void error(final MessageSupplier msgSupplier) {
784        logIfEnabled(FQCN, Level.ERROR, null, msgSupplier, (Throwable) null);
785    }
786
787    @Override
788    public void error(final MessageSupplier msgSupplier, final Throwable t) {
789        logIfEnabled(FQCN, Level.ERROR, null, msgSupplier, t);
790    }
791
792    @Override
793    public void error(final Marker marker, final String message, final Object p0) {
794        logIfEnabled(FQCN, Level.ERROR, marker, message, p0);
795    }
796
797    @Override
798    public void error(final Marker marker, final String message, final Object p0, final Object p1) {
799        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1);
800    }
801
802    @Override
803    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2) {
804        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2);
805    }
806
807    @Override
808    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
809            final Object p3) {
810        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3);
811    }
812
813    @Override
814    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
815            final Object p3, final Object p4) {
816        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4);
817    }
818
819    @Override
820    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
821            final Object p3, final Object p4, final Object p5) {
822        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4, p5);
823    }
824
825    @Override
826    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
827            final Object p3, final Object p4, final Object p5,
828            final Object p6) {
829        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4, p5, p6);
830    }
831
832    @Override
833    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
834            final Object p3, final Object p4, final Object p5,
835            final Object p6, final Object p7) {
836        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
837    }
838
839    @Override
840    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
841            final Object p3, final Object p4, final Object p5,
842            final Object p6, final Object p7, final Object p8) {
843        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
844    }
845
846    @Override
847    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
848            final Object p3, final Object p4, final Object p5,
849            final Object p6, final Object p7, final Object p8, final Object p9) {
850        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
851    }
852
853    @Override
854    public void error(final String message, final Object p0) {
855        logIfEnabled(FQCN, Level.ERROR, null, message, p0);
856    }
857
858    @Override
859    public void error(final String message, final Object p0, final Object p1) {
860        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1);
861    }
862
863    @Override
864    public void error(final String message, final Object p0, final Object p1, final Object p2) {
865        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2);
866    }
867
868    @Override
869    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
870        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3);
871    }
872
873    @Override
874    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
875            final Object p4) {
876        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4);
877    }
878
879    @Override
880    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
881            final Object p4, final Object p5) {
882        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4, p5);
883    }
884
885    @Override
886    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
887            final Object p4, final Object p5, final Object p6) {
888        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4, p5, p6);
889    }
890
891    @Override
892    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
893            final Object p4, final Object p5, final Object p6, final Object p7) {
894        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
895    }
896
897    @Override
898    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
899            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
900        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
901    }
902
903    @Override
904    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
905            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8, final Object p9) {
906        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
907    }
908
909    @Override
910    public void exit() {
911        exit(FQCN, (Object) null);
912    }
913
914    @Override
915    public <R> R exit(final R result) {
916        return exit(FQCN, result);
917    }
918
919    /**
920     * Logs exiting from a method with the result and location information.
921     *
922     * @param fqcn The fully qualified class name of the <b>caller</b>.
923     * @param <R> The type of the parameter and object being returned.
924     * @param result The result being returned from the method call.
925     * @return the return value passed to this method.
926     */
927    protected <R> R exit(final String fqcn, final R result) {
928        logIfEnabled(fqcn, Level.TRACE, EXIT_MARKER, exitMsg(null, result), null);
929        return result;
930    }
931
932    /**
933     * Logs exiting from a method with the result and location information.
934     *
935     * @param fqcn The fully qualified class name of the <b>caller</b>.
936     * @param <R> The type of the parameter and object being returned.
937     * @param result The result being returned from the method call.
938     * @return the return value passed to this method.
939     */
940    protected <R> R exit(final String fqcn, final String format, final R result) {
941        logIfEnabled(fqcn, Level.TRACE, EXIT_MARKER, exitMsg(format, result), null);
942        return result;
943    }
944
945    protected Message exitMsg(final String format, final Object result) {
946        if (result == null) {
947            if (format == null) {
948                return messageFactory.newMessage("Exit");
949            }
950            return messageFactory.newMessage("Exit: " + format);
951        }
952        if (format == null) {
953            return messageFactory.newMessage("Exit with(" + result + ')');
954        }
955        return messageFactory.newMessage("Exit: " + format, result);
956
957    }
958
959    @Override
960    public void fatal(final Marker marker, final Message msg) {
961        logIfEnabled(FQCN, Level.FATAL, marker, msg, msg != null ? msg.getThrowable() : null);
962    }
963
964    @Override
965    public void fatal(final Marker marker, final Message msg, final Throwable t) {
966        logIfEnabled(FQCN, Level.FATAL, marker, msg, t);
967    }
968
969    @Override
970    public void fatal(final Marker marker, final CharSequence message) {
971        logIfEnabled(FQCN, Level.FATAL, marker, message, null);
972    }
973
974    @Override
975    public void fatal(final Marker marker, final CharSequence message, final Throwable t) {
976        logIfEnabled(FQCN, Level.FATAL, marker, message, t);
977    }
978
979    @Override
980    public void fatal(final Marker marker, final Object message) {
981        logIfEnabled(FQCN, Level.FATAL, marker, message, null);
982    }
983
984    @Override
985    public void fatal(final Marker marker, final Object message, final Throwable t) {
986        logIfEnabled(FQCN, Level.FATAL, marker, message, t);
987    }
988
989    @Override
990    public void fatal(final Marker marker, final String message) {
991        logIfEnabled(FQCN, Level.FATAL, marker, message, (Throwable) null);
992    }
993
994    @Override
995    public void fatal(final Marker marker, final String message, final Object... params) {
996        logIfEnabled(FQCN, Level.FATAL, marker, message, params);
997    }
998
999    @Override
1000    public void fatal(final Marker marker, final String message, final Throwable t) {
1001        logIfEnabled(FQCN, Level.FATAL, marker, message, t);
1002    }
1003
1004    @Override
1005    public void fatal(final Message msg) {
1006        logIfEnabled(FQCN, Level.FATAL, null, msg, msg != null ? msg.getThrowable() : null);
1007    }
1008
1009    @Override
1010    public void fatal(final Message msg, final Throwable t) {
1011        logIfEnabled(FQCN, Level.FATAL, null, msg, t);
1012    }
1013
1014    @Override
1015    public void fatal(final CharSequence message) {
1016        logIfEnabled(FQCN, Level.FATAL, null, message, null);
1017    }
1018
1019    @Override
1020    public void fatal(final CharSequence message, final Throwable t) {
1021        logIfEnabled(FQCN, Level.FATAL, null, message, t);
1022    }
1023
1024    @Override
1025    public void fatal(final Object message) {
1026        logIfEnabled(FQCN, Level.FATAL, null, message, null);
1027    }
1028
1029    @Override
1030    public void fatal(final Object message, final Throwable t) {
1031        logIfEnabled(FQCN, Level.FATAL, null, message, t);
1032    }
1033
1034    @Override
1035    public void fatal(final String message) {
1036        logIfEnabled(FQCN, Level.FATAL, null, message, (Throwable) null);
1037    }
1038
1039    @Override
1040    public void fatal(final String message, final Object... params) {
1041        logIfEnabled(FQCN, Level.FATAL, null, message, params);
1042    }
1043
1044    @Override
1045    public void fatal(final String message, final Throwable t) {
1046        logIfEnabled(FQCN, Level.FATAL, null, message, t);
1047    }
1048
1049    @Override
1050    public void fatal(final Supplier<?> msgSupplier) {
1051        logIfEnabled(FQCN, Level.FATAL, null, msgSupplier, (Throwable) null);
1052    }
1053
1054    @Override
1055    public void fatal(final Supplier<?> msgSupplier, final Throwable t) {
1056        logIfEnabled(FQCN, Level.FATAL, null, msgSupplier, t);
1057    }
1058
1059    @Override
1060    public void fatal(final Marker marker, final Supplier<?> msgSupplier) {
1061        logIfEnabled(FQCN, Level.FATAL, marker, msgSupplier, (Throwable) null);
1062    }
1063
1064    @Override
1065    public void fatal(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
1066        logIfEnabled(FQCN, Level.FATAL, marker, message, paramSuppliers);
1067    }
1068
1069    @Override
1070    public void fatal(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
1071        logIfEnabled(FQCN, Level.FATAL, marker, msgSupplier, t);
1072    }
1073
1074    @Override
1075    public void fatal(final String message, final Supplier<?>... paramSuppliers) {
1076        logIfEnabled(FQCN, Level.FATAL, null, message, paramSuppliers);
1077    }
1078
1079    @Override
1080    public void fatal(final Marker marker, final MessageSupplier msgSupplier) {
1081        logIfEnabled(FQCN, Level.FATAL, marker, msgSupplier, (Throwable) null);
1082    }
1083
1084    @Override
1085    public void fatal(final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
1086        logIfEnabled(FQCN, Level.FATAL, marker, msgSupplier, t);
1087    }
1088
1089    @Override
1090    public void fatal(final MessageSupplier msgSupplier) {
1091        logIfEnabled(FQCN, Level.FATAL, null, msgSupplier, (Throwable) null);
1092    }
1093
1094    @Override
1095    public void fatal(final MessageSupplier msgSupplier, final Throwable t) {
1096        logIfEnabled(FQCN, Level.FATAL, null, msgSupplier, t);
1097    }
1098
1099    @Override
1100    public void fatal(final Marker marker, final String message, final Object p0) {
1101        logIfEnabled(FQCN, Level.FATAL, marker, message, p0);
1102    }
1103
1104    @Override
1105    public void fatal(final Marker marker, final String message, final Object p0, final Object p1) {
1106        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1);
1107    }
1108
1109    @Override
1110    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2) {
1111        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2);
1112    }
1113
1114    @Override
1115    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1116            final Object p3) {
1117        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3);
1118    }
1119
1120    @Override
1121    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1122            final Object p3, final Object p4) {
1123        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4);
1124    }
1125
1126    @Override
1127    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1128            final Object p3, final Object p4, final Object p5) {
1129        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4, p5);
1130    }
1131
1132    @Override
1133    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1134            final Object p3, final Object p4, final Object p5, final Object p6) {
1135        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4, p5, p6);
1136    }
1137
1138    @Override
1139    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1140            final Object p3, final Object p4, final Object p5, final Object p6, final Object p7) {
1141        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
1142    }
1143
1144    @Override
1145    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1146            final Object p3, final Object p4, final Object p5,
1147            final Object p6, final Object p7, final Object p8) {
1148        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
1149    }
1150
1151    @Override
1152    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1153            final Object p3, final Object p4, final Object p5,
1154            final Object p6, final Object p7, final Object p8, final Object p9) {
1155        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1156    }
1157
1158    @Override
1159    public void fatal(final String message, final Object p0) {
1160        logIfEnabled(FQCN, Level.FATAL, null, message, p0);
1161    }
1162
1163    @Override
1164    public void fatal(final String message, final Object p0, final Object p1) {
1165        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1);
1166    }
1167
1168    @Override
1169    public void fatal(final String message, final Object p0, final Object p1, final Object p2) {
1170        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2);
1171    }
1172
1173    @Override
1174    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
1175        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3);
1176    }
1177
1178    @Override
1179    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1180            final Object p4) {
1181        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4);
1182    }
1183
1184    @Override
1185    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1186            final Object p4, final Object p5) {
1187        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4, p5);
1188    }
1189
1190    @Override
1191    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1192            final Object p4, final Object p5, final Object p6) {
1193        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4, p5, p6);
1194    }
1195
1196    @Override
1197    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1198            final Object p4, final Object p5, final Object p6, final Object p7) {
1199        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
1200    }
1201
1202    @Override
1203    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1204            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
1205        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
1206    }
1207
1208    @Override
1209    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1210            final Object p4, final Object p5, final Object p6,
1211            final Object p7, final Object p8, final Object p9) {
1212        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1213    }
1214
1215    @SuppressWarnings("unchecked")
1216    @Override
1217    public <MF extends MessageFactory> MF getMessageFactory() {
1218        return (MF) messageFactory;
1219    }
1220
1221    @Override
1222    public String getName() {
1223        return name;
1224    }
1225
1226    @Override
1227    public void info(final Marker marker, final Message msg) {
1228        logIfEnabled(FQCN, Level.INFO, marker, msg, msg != null ? msg.getThrowable() : null);
1229    }
1230
1231    @Override
1232    public void info(final Marker marker, final Message msg, final Throwable t) {
1233        logIfEnabled(FQCN, Level.INFO, marker, msg, t);
1234    }
1235
1236    @Override
1237    public void info(final Marker marker, final CharSequence message) {
1238        logIfEnabled(FQCN, Level.INFO, marker, message, null);
1239    }
1240
1241    @Override
1242    public void info(final Marker marker, final CharSequence message, final Throwable t) {
1243        logIfEnabled(FQCN, Level.INFO, marker, message, t);
1244    }
1245
1246    @Override
1247    public void info(final Marker marker, final Object message) {
1248        logIfEnabled(FQCN, Level.INFO, marker, message, null);
1249    }
1250
1251    @Override
1252    public void info(final Marker marker, final Object message, final Throwable t) {
1253        logIfEnabled(FQCN, Level.INFO, marker, message, t);
1254    }
1255
1256    @Override
1257    public void info(final Marker marker, final String message) {
1258        logIfEnabled(FQCN, Level.INFO, marker, message, (Throwable) null);
1259    }
1260
1261    @Override
1262    public void info(final Marker marker, final String message, final Object... params) {
1263        logIfEnabled(FQCN, Level.INFO, marker, message, params);
1264    }
1265
1266    @Override
1267    public void info(final Marker marker, final String message, final Throwable t) {
1268        logIfEnabled(FQCN, Level.INFO, marker, message, t);
1269    }
1270
1271    @Override
1272    public void info(final Message msg) {
1273        logIfEnabled(FQCN, Level.INFO, null, msg, msg != null ? msg.getThrowable() : null);
1274    }
1275
1276    @Override
1277    public void info(final Message msg, final Throwable t) {
1278        logIfEnabled(FQCN, Level.INFO, null, msg, t);
1279    }
1280
1281    @Override
1282    public void info(final CharSequence message) {
1283        logIfEnabled(FQCN, Level.INFO, null, message, null);
1284    }
1285
1286    @Override
1287    public void info(final CharSequence message, final Throwable t) {
1288        logIfEnabled(FQCN, Level.INFO, null, message, t);
1289    }
1290
1291    @Override
1292    public void info(final Object message) {
1293        logIfEnabled(FQCN, Level.INFO, null, message, null);
1294    }
1295
1296    @Override
1297    public void info(final Object message, final Throwable t) {
1298        logIfEnabled(FQCN, Level.INFO, null, message, t);
1299    }
1300
1301    @Override
1302    public void info(final String message) {
1303        logIfEnabled(FQCN, Level.INFO, null, message, (Throwable) null);
1304    }
1305
1306    @Override
1307    public void info(final String message, final Object... params) {
1308        logIfEnabled(FQCN, Level.INFO, null, message, params);
1309    }
1310
1311    @Override
1312    public void info(final String message, final Throwable t) {
1313        logIfEnabled(FQCN, Level.INFO, null, message, t);
1314    }
1315
1316    @Override
1317    public void info(final Supplier<?> msgSupplier) {
1318        logIfEnabled(FQCN, Level.INFO, null, msgSupplier, (Throwable) null);
1319    }
1320
1321    @Override
1322    public void info(final Supplier<?> msgSupplier, final Throwable t) {
1323        logIfEnabled(FQCN, Level.INFO, null, msgSupplier, t);
1324    }
1325
1326    @Override
1327    public void info(final Marker marker, final Supplier<?> msgSupplier) {
1328        logIfEnabled(FQCN, Level.INFO, marker, msgSupplier, (Throwable) null);
1329    }
1330
1331    @Override
1332    public void info(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
1333        logIfEnabled(FQCN, Level.INFO, marker, message, paramSuppliers);
1334    }
1335
1336    @Override
1337    public void info(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
1338        logIfEnabled(FQCN, Level.INFO, marker, msgSupplier, t);
1339    }
1340
1341    @Override
1342    public void info(final String message, final Supplier<?>... paramSuppliers) {
1343        logIfEnabled(FQCN, Level.INFO, null, message, paramSuppliers);
1344    }
1345
1346    @Override
1347    public void info(final Marker marker, final MessageSupplier msgSupplier) {
1348        logIfEnabled(FQCN, Level.INFO, marker, msgSupplier, (Throwable) null);
1349    }
1350
1351    @Override
1352    public void info(final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
1353        logIfEnabled(FQCN, Level.INFO, marker, msgSupplier, t);
1354    }
1355
1356    @Override
1357    public void info(final MessageSupplier msgSupplier) {
1358        logIfEnabled(FQCN, Level.INFO, null, msgSupplier, (Throwable) null);
1359    }
1360
1361    @Override
1362    public void info(final MessageSupplier msgSupplier, final Throwable t) {
1363        logIfEnabled(FQCN, Level.INFO, null, msgSupplier, t);
1364    }
1365
1366    @Override
1367    public void info(final Marker marker, final String message, final Object p0) {
1368        logIfEnabled(FQCN, Level.INFO, marker, message, p0);
1369    }
1370
1371    @Override
1372    public void info(final Marker marker, final String message, final Object p0, final Object p1) {
1373        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1);
1374    }
1375
1376    @Override
1377    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2) {
1378        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2);
1379    }
1380
1381    @Override
1382    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1383            final Object p3) {
1384        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3);
1385    }
1386
1387    @Override
1388    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1389            final Object p3, final Object p4) {
1390        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4);
1391    }
1392
1393    @Override
1394    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1395            final Object p3, final Object p4, final Object p5) {
1396        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4, p5);
1397    }
1398
1399    @Override
1400    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1401            final Object p3, final Object p4, final Object p5, final Object p6) {
1402        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4, p5, p6);
1403    }
1404
1405    @Override
1406    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1407            final Object p3, final Object p4, final Object p5, final Object p6, final Object p7) {
1408        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
1409    }
1410
1411    @Override
1412    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1413            final Object p3, final Object p4, final Object p5,
1414            final Object p6, final Object p7, final Object p8) {
1415        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
1416    }
1417
1418    @Override
1419    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1420            final Object p3, final Object p4, final Object p5,
1421            final Object p6, final Object p7, final Object p8, final Object p9) {
1422        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1423    }
1424
1425    @Override
1426    public void info(final String message, final Object p0) {
1427        logIfEnabled(FQCN, Level.INFO, null, message, p0);
1428    }
1429
1430    @Override
1431    public void info(final String message, final Object p0, final Object p1) {
1432        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1);
1433    }
1434
1435    @Override
1436    public void info(final String message, final Object p0, final Object p1, final Object p2) {
1437        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2);
1438    }
1439
1440    @Override
1441    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
1442        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3);
1443    }
1444
1445    @Override
1446    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1447            final Object p4) {
1448        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4);
1449    }
1450
1451    @Override
1452    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1453            final Object p4, final Object p5) {
1454        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4, p5);
1455    }
1456
1457    @Override
1458    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1459            final Object p4, final Object p5, final Object p6) {
1460        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4, p5, p6);
1461    }
1462
1463    @Override
1464    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1465            final Object p4, final Object p5, final Object p6,
1466            final Object p7) {
1467        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
1468    }
1469
1470    @Override
1471    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1472            final Object p4, final Object p5, final Object p6,
1473            final Object p7, final Object p8) {
1474        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
1475    }
1476
1477    @Override
1478    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1479            final Object p4, final Object p5, final Object p6,
1480            final Object p7, final Object p8, final Object p9) {
1481        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1482    }
1483
1484    @Override
1485    public boolean isDebugEnabled() {
1486        return isEnabled(Level.DEBUG, null, null);
1487    }
1488
1489    @Override
1490    public boolean isDebugEnabled(final Marker marker) {
1491        return isEnabled(Level.DEBUG, marker, (Object) null, null);
1492    }
1493
1494    @Override
1495    public boolean isEnabled(final Level level) {
1496        return isEnabled(level, null, (Object) null, null);
1497    }
1498
1499    @Override
1500    public boolean isEnabled(final Level level, final Marker marker) {
1501        return isEnabled(level, marker, (Object) null, null);
1502    }
1503
1504    @Override
1505    public boolean isErrorEnabled() {
1506        return isEnabled(Level.ERROR, null, (Object) null, null);
1507    }
1508
1509    @Override
1510    public boolean isErrorEnabled(final Marker marker) {
1511        return isEnabled(Level.ERROR, marker, (Object) null, null);
1512    }
1513
1514    @Override
1515    public boolean isFatalEnabled() {
1516        return isEnabled(Level.FATAL, null, (Object) null, null);
1517    }
1518
1519    @Override
1520    public boolean isFatalEnabled(final Marker marker) {
1521        return isEnabled(Level.FATAL, marker, (Object) null, null);
1522    }
1523
1524    @Override
1525    public boolean isInfoEnabled() {
1526        return isEnabled(Level.INFO, null, (Object) null, null);
1527    }
1528
1529    @Override
1530    public boolean isInfoEnabled(final Marker marker) {
1531        return isEnabled(Level.INFO, marker, (Object) null, null);
1532    }
1533
1534    @Override
1535    public boolean isTraceEnabled() {
1536        return isEnabled(Level.TRACE, null, (Object) null, null);
1537    }
1538
1539    @Override
1540    public boolean isTraceEnabled(final Marker marker) {
1541        return isEnabled(Level.TRACE, marker, (Object) null, null);
1542    }
1543
1544    @Override
1545    public boolean isWarnEnabled() {
1546        return isEnabled(Level.WARN, null, (Object) null, null);
1547    }
1548
1549    @Override
1550    public boolean isWarnEnabled(final Marker marker) {
1551        return isEnabled(Level.WARN, marker, (Object) null, null);
1552    }
1553
1554    @Override
1555    public void log(final Level level, final Marker marker, final Message msg) {
1556        logIfEnabled(FQCN, level, marker, msg, msg != null ? msg.getThrowable() : null);
1557    }
1558
1559    @Override
1560    public void log(final Level level, final Marker marker, final Message msg, final Throwable t) {
1561        logIfEnabled(FQCN, level, marker, msg, t);
1562    }
1563
1564    @Override
1565    public void log(final Level level, final Marker marker, final CharSequence message) {
1566        logIfEnabled(FQCN, level, marker, message, (Throwable) null);
1567    }
1568
1569    @Override
1570    public void log(final Level level, final Marker marker, final CharSequence message, final Throwable t) {
1571        if (isEnabled(level, marker, message, t)) {
1572            logMessage(FQCN, level, marker, message, t);
1573        }
1574    }
1575
1576    @Override
1577    public void log(final Level level, final Marker marker, final Object message) {
1578        logIfEnabled(FQCN, level, marker, message, (Throwable) null);
1579    }
1580
1581    @Override
1582    public void log(final Level level, final Marker marker, final Object message, final Throwable t) {
1583        if (isEnabled(level, marker, message, t)) {
1584            logMessage(FQCN, level, marker, message, t);
1585        }
1586    }
1587
1588    @Override
1589    public void log(final Level level, final Marker marker, final String message) {
1590        logIfEnabled(FQCN, level, marker, message, (Throwable) null);
1591    }
1592
1593    @Override
1594    public void log(final Level level, final Marker marker, final String message, final Object... params) {
1595        logIfEnabled(FQCN, level, marker, message, params);
1596    }
1597
1598    @Override
1599    public void log(final Level level, final Marker marker, final String message, final Throwable t) {
1600        logIfEnabled(FQCN, level, marker, message, t);
1601    }
1602
1603    @Override
1604    public void log(final Level level, final Message msg) {
1605        logIfEnabled(FQCN, level, null, msg, msg != null ? msg.getThrowable() : null);
1606    }
1607
1608    @Override
1609    public void log(final Level level, final Message msg, final Throwable t) {
1610        logIfEnabled(FQCN, level, null, msg, t);
1611    }
1612
1613    @Override
1614    public void log(final Level level, final CharSequence message) {
1615        logIfEnabled(FQCN, level, null, message, null);
1616    }
1617
1618    @Override
1619    public void log(final Level level, final CharSequence message, final Throwable t) {
1620        logIfEnabled(FQCN, level, null, message, t);
1621    }
1622
1623    @Override
1624    public void log(final Level level, final Object message) {
1625        logIfEnabled(FQCN, level, null, message, null);
1626    }
1627
1628    @Override
1629    public void log(final Level level, final Object message, final Throwable t) {
1630        logIfEnabled(FQCN, level, null, message, t);
1631    }
1632
1633    @Override
1634    public void log(final Level level, final String message) {
1635        logIfEnabled(FQCN, level, null, message, (Throwable) null);
1636    }
1637
1638    @Override
1639    public void log(final Level level, final String message, final Object... params) {
1640        logIfEnabled(FQCN, level, null, message, params);
1641    }
1642
1643    @Override
1644    public void log(final Level level, final String message, final Throwable t) {
1645        logIfEnabled(FQCN, level, null, message, t);
1646    }
1647
1648    @Override
1649    public void log(final Level level, final Supplier<?> msgSupplier) {
1650        logIfEnabled(FQCN, level, null, msgSupplier, (Throwable) null);
1651    }
1652
1653    @Override
1654    public void log(final Level level, final Supplier<?> msgSupplier, final Throwable t) {
1655        logIfEnabled(FQCN, level, null, msgSupplier, t);
1656    }
1657
1658    @Override
1659    public void log(final Level level, final Marker marker, final Supplier<?> msgSupplier) {
1660        logIfEnabled(FQCN, level, marker, msgSupplier, (Throwable) null);
1661    }
1662
1663    @Override
1664    public void log(final Level level, final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
1665        logIfEnabled(FQCN, level, marker, message, paramSuppliers);
1666    }
1667
1668    @Override
1669    public void log(final Level level, final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
1670        logIfEnabled(FQCN, level, marker, msgSupplier, t);
1671    }
1672
1673    @Override
1674    public void log(final Level level, final String message, final Supplier<?>... paramSuppliers) {
1675        logIfEnabled(FQCN, level, null, message, paramSuppliers);
1676    }
1677
1678    @Override
1679    public void log(final Level level, final Marker marker, final MessageSupplier msgSupplier) {
1680        logIfEnabled(FQCN, level, marker, msgSupplier, (Throwable) null);
1681    }
1682
1683    @Override
1684    public void log(final Level level, final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
1685        logIfEnabled(FQCN, level, marker, msgSupplier, t);
1686    }
1687
1688    @Override
1689    public void log(final Level level, final MessageSupplier msgSupplier) {
1690        logIfEnabled(FQCN, level, null, msgSupplier, (Throwable) null);
1691    }
1692
1693    @Override
1694    public void log(final Level level, final MessageSupplier msgSupplier, final Throwable t) {
1695        logIfEnabled(FQCN, level, null, msgSupplier, t);
1696    }
1697
1698    @Override
1699    public void log(final Level level, final Marker marker, final String message, final Object p0) {
1700        logIfEnabled(FQCN, level, marker, message, p0);
1701    }
1702
1703    @Override
1704    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1) {
1705        logIfEnabled(FQCN, level, marker, message, p0, p1);
1706    }
1707
1708    @Override
1709    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1710            final Object p2) {
1711        logIfEnabled(FQCN, level, marker, message, p0, p1, p2);
1712    }
1713
1714    @Override
1715    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1716            final Object p2, final Object p3) {
1717        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3);
1718    }
1719
1720    @Override
1721    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1722            final Object p2, final Object p3, final Object p4) {
1723        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4);
1724    }
1725
1726    @Override
1727    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1728            final Object p2, final Object p3, final Object p4, final Object p5) {
1729        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4, p5);
1730    }
1731
1732    @Override
1733    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1734            final Object p2, final Object p3, final Object p4, final Object p5, final Object p6) {
1735        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4, p5, p6);
1736    }
1737
1738    @Override
1739    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1740            final Object p2, final Object p3, final Object p4, final Object p5,
1741            final Object p6, final Object p7) {
1742        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
1743    }
1744
1745    @Override
1746    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1747            final Object p2, final Object p3, final Object p4, final Object p5,
1748            final Object p6, final Object p7, final Object p8) {
1749        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
1750    }
1751
1752    @Override
1753    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1754            final Object p2, final Object p3, final Object p4, final Object p5,
1755            final Object p6, final Object p7, final Object p8, final Object p9) {
1756        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1757    }
1758
1759    @Override
1760    public void log(final Level level, final String message, final Object p0) {
1761        logIfEnabled(FQCN, level, null, message, p0);
1762    }
1763
1764    @Override
1765    public void log(final Level level, final String message, final Object p0, final Object p1) {
1766        logIfEnabled(FQCN, level, null, message, p0, p1);
1767    }
1768
1769    @Override
1770    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2) {
1771        logIfEnabled(FQCN, level, null, message, p0, p1, p2);
1772    }
1773
1774    @Override
1775    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
1776        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3);
1777    }
1778
1779    @Override
1780    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1781            final Object p4) {
1782        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4);
1783    }
1784
1785    @Override
1786    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1787            final Object p4, final Object p5) {
1788        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4, p5);
1789    }
1790
1791    @Override
1792    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1793            final Object p4, final Object p5, final Object p6) {
1794        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4, p5, p6);
1795    }
1796
1797    @Override
1798    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1799            final Object p4, final Object p5, final Object p6, final Object p7) {
1800        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
1801    }
1802
1803    @Override
1804    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1805            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
1806        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
1807    }
1808
1809    @Override
1810    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1811            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8, final Object p9) {
1812        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1813    }
1814
1815    @Override
1816    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final Message msg,
1817            final Throwable t) {
1818        if (isEnabled(level, marker, msg, t)) {
1819            logMessageSafely(fqcn, level, marker, msg, t);
1820        }
1821    }
1822
1823    @Override
1824    public void logIfEnabled(final String fqcn, final Level level, final Marker marker,
1825            final MessageSupplier msgSupplier, final Throwable t) {
1826        if (isEnabled(level, marker, msgSupplier, t)) {
1827            logMessage(fqcn, level, marker, msgSupplier, t);
1828        }
1829    }
1830
1831    @Override
1832    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final Object message,
1833            final Throwable t) {
1834        if (isEnabled(level, marker, message, t)) {
1835            logMessage(fqcn, level, marker, message, t);
1836        }
1837    }
1838
1839    @Override
1840    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final CharSequence message,
1841            final Throwable t) {
1842        if (isEnabled(level, marker, message, t)) {
1843            logMessage(fqcn, level, marker, message, t);
1844        }
1845    }
1846
1847    @Override
1848    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final Supplier<?> msgSupplier,
1849            final Throwable t) {
1850        if (isEnabled(level, marker, msgSupplier, t)) {
1851            logMessage(fqcn, level, marker, msgSupplier, t);
1852        }
1853    }
1854
1855    @Override
1856    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message) {
1857        if (isEnabled(level, marker, message)) {
1858            logMessage(fqcn, level, marker, message);
1859        }
1860    }
1861
1862    @Override
1863    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1864            final Supplier<?>... paramSuppliers) {
1865        if (isEnabled(level, marker, message)) {
1866            logMessage(fqcn, level, marker, message, paramSuppliers);
1867        }
1868    }
1869
1870    @Override
1871    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1872            final Object... params) {
1873        if (isEnabled(level, marker, message, params)) {
1874            logMessage(fqcn, level, marker, message, params);
1875        }
1876    }
1877
1878    @Override
1879    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1880            final Object p0) {
1881        if (isEnabled(level, marker, message, p0)) {
1882            logMessage(fqcn, level, marker, message, p0);
1883        }
1884    }
1885
1886    @Override
1887    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1888            final Object p0, final Object p1) {
1889        if (isEnabled(level, marker, message, p0, p1)) {
1890            logMessage(fqcn, level, marker, message, p0, p1);
1891        }
1892    }
1893
1894    @Override
1895    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1896            final Object p0, final Object p1, final Object p2) {
1897        if (isEnabled(level, marker, message, p0, p1, p2)) {
1898            logMessage(fqcn, level, marker, message, p0, p1, p2);
1899        }
1900    }
1901
1902    @Override
1903    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1904            final Object p0, final Object p1, final Object p2, final Object p3) {
1905        if (isEnabled(level, marker, message, p0, p1, p2, p3)) {
1906            logMessage(fqcn, level, marker, message, p0, p1, p2, p3);
1907        }
1908    }
1909
1910    @Override
1911    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1912            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4) {
1913        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4)) {
1914            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4);
1915        }
1916    }
1917
1918    @Override
1919    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1920            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5) {
1921        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4, p5)) {
1922            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4, p5);
1923        }
1924    }
1925
1926    @Override
1927    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1928            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
1929            final Object p6) {
1930        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4, p5, p6)) {
1931            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4, p5, p6);
1932        }
1933    }
1934
1935    @Override
1936    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1937            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
1938            final Object p6, final Object p7) {
1939        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7)) {
1940            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
1941        }
1942    }
1943
1944    @Override
1945    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1946            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
1947            final Object p6, final Object p7, final Object p8) {
1948        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
1949            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
1950        }
1951    }
1952
1953    @Override
1954    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1955            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
1956            final Object p6, final Object p7, final Object p8, final Object p9) {
1957        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
1958            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1959        }
1960    }
1961
1962    @Override
1963    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1964            final Throwable t) {
1965        if (isEnabled(level, marker, message, t)) {
1966            logMessage(fqcn, level, marker, message, t);
1967        }
1968    }
1969
1970    protected void logMessage(final String fqcn, final Level level, final Marker marker, final CharSequence message,
1971            final Throwable t) {
1972        logMessageSafely(fqcn, level, marker, messageFactory.newMessage(message), t);
1973    }
1974
1975    protected void logMessage(final String fqcn, final Level level, final Marker marker, final Object message,
1976            final Throwable t) {
1977        logMessageSafely(fqcn, level, marker, messageFactory.newMessage(message), t);
1978    }
1979
1980    protected void logMessage(final String fqcn, final Level level, final Marker marker,
1981            final MessageSupplier msgSupplier, final Throwable t) {
1982        final Message message = LambdaUtil.get(msgSupplier);
1983        logMessageSafely(fqcn, level, marker, message, (t == null && message != null) ? message.getThrowable() : t);
1984    }
1985
1986    protected void logMessage(final String fqcn, final Level level, final Marker marker, final Supplier<?> msgSupplier,
1987            final Throwable t) {
1988        final Message message = LambdaUtil.getMessage(msgSupplier, messageFactory);
1989        logMessageSafely(fqcn, level, marker, message, (t == null && message != null) ? message.getThrowable() : t);
1990    }
1991
1992    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
1993            final Throwable t) {
1994        logMessageSafely(fqcn, level, marker, messageFactory.newMessage(message), t);
1995    }
1996
1997    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message) {
1998        final Message msg = messageFactory.newMessage(message);
1999        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2000    }
2001
2002    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2003            final Object... params) {
2004        final Message msg = messageFactory.newMessage(message, params);
2005        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2006    }
2007
2008    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2009            final Object p0) {
2010        final Message msg = messageFactory.newMessage(message, p0);
2011        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2012    }
2013
2014    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2015            final Object p0, final Object p1) {
2016        final Message msg = messageFactory.newMessage(message, p0, p1);
2017        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2018    }
2019
2020    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2021            final Object p0, final Object p1, final Object p2) {
2022        final Message msg = messageFactory.newMessage(message, p0, p1, p2);
2023        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2024    }
2025
2026    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2027            final Object p0, final Object p1, final Object p2, final Object p3) {
2028        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3);
2029        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2030    }
2031
2032    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2033            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4) {
2034        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4);
2035        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2036    }
2037
2038    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2039            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5) {
2040        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5);
2041        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2042    }
2043
2044    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2045            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
2046            final Object p6) {
2047        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5, p6);
2048        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2049    }
2050
2051    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2052            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
2053            final Object p6, final Object p7) {
2054        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5, p6, p7);
2055        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2056    }
2057
2058    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2059            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
2060            final Object p6, final Object p7, final Object p8) {
2061        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
2062        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2063    }
2064
2065    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2066            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
2067            final Object p6, final Object p7, final Object p8, final Object p9) {
2068        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
2069        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2070    }
2071
2072    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2073            final Supplier<?>... paramSuppliers) {
2074        final Message msg = messageFactory.newMessage(message, LambdaUtil.getAll(paramSuppliers));
2075        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2076    }
2077
2078    @Override
2079    public void printf(final Level level, final Marker marker, final String format, final Object... params) {
2080        if (isEnabled(level, marker, format, params)) {
2081            final Message msg = new StringFormattedMessage(format, params);
2082            logMessageSafely(FQCN, level, marker, msg, msg.getThrowable());
2083        }
2084    }
2085
2086    @Override
2087    public void printf(final Level level, final String format, final Object... params) {
2088        if (isEnabled(level, null, format, params)) {
2089            final Message msg = new StringFormattedMessage(format, params);
2090            logMessageSafely(FQCN, level, null, msg, msg.getThrowable());
2091        }
2092    }
2093
2094    @PerformanceSensitive
2095    // NOTE: This is a hot method. Current implementation compiles to 30 bytes of byte code.
2096    // This is within the 35 byte MaxInlineSize threshold. Modify with care!
2097    private void logMessageSafely(final String fqcn, final Level level, final Marker marker, final Message msg,
2098            final Throwable throwable) {
2099        try {
2100            tryLogMessage(fqcn, level, marker, msg, throwable);
2101        } finally {
2102            // LOG4J2-1583 prevent scrambled logs when logging calls are nested (logging in toString())
2103            ReusableMessageFactory.release(msg);
2104        }
2105    }
2106
2107    @PerformanceSensitive
2108    // NOTE: This is a hot method. Current implementation compiles to 26 bytes of byte code.
2109    // This is within the 35 byte MaxInlineSize threshold (on which JMV and version?). Modify with care!
2110    private void tryLogMessage(final String fqcn,
2111                               final Level level,
2112                               final Marker marker,
2113                               final Message msg,
2114                               final Throwable throwable) {
2115        try {
2116            logMessage(fqcn, level, marker, msg, throwable);
2117        } catch (final Exception e) {
2118            // LOG4J2-1990 Log4j2 suppresses all exceptions that occur once application called the logger
2119            handleLogMessageException(e, fqcn, msg);
2120        }
2121    }
2122
2123    // LOG4J2-1990 Log4j2 suppresses all exceptions that occur once application called the logger
2124    // TODO Configuration setting to propagate exceptions back to the caller *if requested*
2125    private void handleLogMessageException(final Exception exception, final String fqcn, final Message msg) {
2126        if (exception instanceof LoggingException) {
2127            throw (LoggingException) exception;
2128        }
2129        final String format = msg.getFormat();
2130        final StringBuilder sb = new StringBuilder(format.length() + 100);
2131        sb.append(fqcn);
2132        sb.append(" caught ");
2133        sb.append(exception.getClass().getName());
2134        sb.append(" logging ");
2135        sb.append(msg.getClass().getSimpleName());
2136        sb.append(": ");
2137        sb.append(format);
2138        StatusLogger.getLogger().warn(sb.toString(), exception);
2139    }
2140
2141    @Override
2142    public <T extends Throwable> T throwing(final T t) {
2143        return throwing(FQCN, Level.ERROR, t);
2144    }
2145
2146    @Override
2147    public <T extends Throwable> T throwing(final Level level, final T t) {
2148        return throwing(FQCN, level, t);
2149    }
2150
2151    /**
2152     * Logs a Throwable to be thrown.
2153     *
2154     * @param <T> the type of the Throwable.
2155     * @param fqcn the fully qualified class name of this Logger implementation.
2156     * @param level The logging Level.
2157     * @param t The Throwable.
2158     * @return the Throwable.
2159     */
2160    protected <T extends Throwable> T throwing(final String fqcn, final Level level, final T t) {
2161        if (isEnabled(level, THROWING_MARKER, (Object) null, null)) {
2162            logMessageSafely(fqcn, level, THROWING_MARKER, throwingMsg(t), t);
2163        }
2164        return t;
2165    }
2166
2167    protected Message throwingMsg(final Throwable t) {
2168        return messageFactory.newMessage(THROWING);
2169    }
2170
2171    @Override
2172    public void trace(final Marker marker, final Message msg) {
2173        logIfEnabled(FQCN, Level.TRACE, marker, msg, msg != null ? msg.getThrowable() : null);
2174    }
2175
2176    @Override
2177    public void trace(final Marker marker, final Message msg, final Throwable t) {
2178        logIfEnabled(FQCN, Level.TRACE, marker, msg, t);
2179    }
2180
2181    @Override
2182    public void trace(final Marker marker, final CharSequence message) {
2183        logIfEnabled(FQCN, Level.TRACE, marker, message, null);
2184    }
2185
2186    @Override
2187    public void trace(final Marker marker, final CharSequence message, final Throwable t) {
2188        logIfEnabled(FQCN, Level.TRACE, marker, message, t);
2189    }
2190
2191    @Override
2192    public void trace(final Marker marker, final Object message) {
2193        logIfEnabled(FQCN, Level.TRACE, marker, message, null);
2194    }
2195
2196    @Override
2197    public void trace(final Marker marker, final Object message, final Throwable t) {
2198        logIfEnabled(FQCN, Level.TRACE, marker, message, t);
2199    }
2200
2201    @Override
2202    public void trace(final Marker marker, final String message) {
2203        logIfEnabled(FQCN, Level.TRACE, marker, message, (Throwable) null);
2204    }
2205
2206    @Override
2207    public void trace(final Marker marker, final String message, final Object... params) {
2208        logIfEnabled(FQCN, Level.TRACE, marker, message, params);
2209    }
2210
2211    @Override
2212    public void trace(final Marker marker, final String message, final Throwable t) {
2213        logIfEnabled(FQCN, Level.TRACE, marker, message, t);
2214    }
2215
2216    @Override
2217    public void trace(final Message msg) {
2218        logIfEnabled(FQCN, Level.TRACE, null, msg, msg != null ? msg.getThrowable() : null);
2219    }
2220
2221    @Override
2222    public void trace(final Message msg, final Throwable t) {
2223        logIfEnabled(FQCN, Level.TRACE, null, msg, t);
2224    }
2225
2226    @Override
2227    public void trace(final CharSequence message) {
2228        logIfEnabled(FQCN, Level.TRACE, null, message, null);
2229    }
2230
2231    @Override
2232    public void trace(final CharSequence message, final Throwable t) {
2233        logIfEnabled(FQCN, Level.TRACE, null, message, t);
2234    }
2235
2236    @Override
2237    public void trace(final Object message) {
2238        logIfEnabled(FQCN, Level.TRACE, null, message, null);
2239    }
2240
2241    @Override
2242    public void trace(final Object message, final Throwable t) {
2243        logIfEnabled(FQCN, Level.TRACE, null, message, t);
2244    }
2245
2246    @Override
2247    public void trace(final String message) {
2248        logIfEnabled(FQCN, Level.TRACE, null, message, (Throwable) null);
2249    }
2250
2251    @Override
2252    public void trace(final String message, final Object... params) {
2253        logIfEnabled(FQCN, Level.TRACE, null, message, params);
2254    }
2255
2256    @Override
2257    public void trace(final String message, final Throwable t) {
2258        logIfEnabled(FQCN, Level.TRACE, null, message, t);
2259    }
2260
2261    @Override
2262    public void trace(final Supplier<?> msgSupplier) {
2263        logIfEnabled(FQCN, Level.TRACE, null, msgSupplier, (Throwable) null);
2264    }
2265
2266    @Override
2267    public void trace(final Supplier<?> msgSupplier, final Throwable t) {
2268        logIfEnabled(FQCN, Level.TRACE, null, msgSupplier, t);
2269    }
2270
2271    @Override
2272    public void trace(final Marker marker, final Supplier<?> msgSupplier) {
2273        logIfEnabled(FQCN, Level.TRACE, marker, msgSupplier, (Throwable) null);
2274    }
2275
2276    @Override
2277    public void trace(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
2278        logIfEnabled(FQCN, Level.TRACE, marker, message, paramSuppliers);
2279    }
2280
2281    @Override
2282    public void trace(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
2283        logIfEnabled(FQCN, Level.TRACE, marker, msgSupplier, t);
2284    }
2285
2286    @Override
2287    public void trace(final String message, final Supplier<?>... paramSuppliers) {
2288        logIfEnabled(FQCN, Level.TRACE, null, message, paramSuppliers);
2289    }
2290
2291    @Override
2292    public void trace(final Marker marker, final MessageSupplier msgSupplier) {
2293        logIfEnabled(FQCN, Level.TRACE, marker, msgSupplier, (Throwable) null);
2294    }
2295
2296    @Override
2297    public void trace(final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
2298        logIfEnabled(FQCN, Level.TRACE, marker, msgSupplier, t);
2299    }
2300
2301    @Override
2302    public void trace(final MessageSupplier msgSupplier) {
2303        logIfEnabled(FQCN, Level.TRACE, null, msgSupplier, (Throwable) null);
2304    }
2305
2306    @Override
2307    public void trace(final MessageSupplier msgSupplier, final Throwable t) {
2308        logIfEnabled(FQCN, Level.TRACE, null, msgSupplier, t);
2309    }
2310
2311    @Override
2312    public void trace(final Marker marker, final String message, final Object p0) {
2313        logIfEnabled(FQCN, Level.TRACE, marker, message, p0);
2314    }
2315
2316    @Override
2317    public void trace(final Marker marker, final String message, final Object p0, final Object p1) {
2318        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1);
2319    }
2320
2321    @Override
2322    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2) {
2323        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2);
2324    }
2325
2326    @Override
2327    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2328            final Object p3) {
2329        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3);
2330    }
2331
2332    @Override
2333    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2334            final Object p3, final Object p4) {
2335        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4);
2336    }
2337
2338    @Override
2339    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2340            final Object p3, final Object p4, final Object p5) {
2341        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4, p5);
2342    }
2343
2344    @Override
2345    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2346            final Object p3, final Object p4, final Object p5, final Object p6) {
2347        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4, p5, p6);
2348    }
2349
2350    @Override
2351    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2352            final Object p3, final Object p4, final Object p5, final Object p6, final Object p7) {
2353        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
2354    }
2355
2356    @Override
2357    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2358            final Object p3, final Object p4, final Object p5,
2359            final Object p6, final Object p7, final Object p8) {
2360        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
2361    }
2362
2363    @Override
2364    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2365            final Object p3, final Object p4, final Object p5,
2366            final Object p6, final Object p7, final Object p8, final Object p9) {
2367        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
2368    }
2369
2370    @Override
2371    public void trace(final String message, final Object p0) {
2372        logIfEnabled(FQCN, Level.TRACE, null, message, p0);
2373    }
2374
2375    @Override
2376    public void trace(final String message, final Object p0, final Object p1) {
2377        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1);
2378    }
2379
2380    @Override
2381    public void trace(final String message, final Object p0, final Object p1, final Object p2) {
2382        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2);
2383    }
2384
2385    @Override
2386    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
2387        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3);
2388    }
2389
2390    @Override
2391    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2392            final Object p4) {
2393        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4);
2394    }
2395
2396    @Override
2397    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2398            final Object p4, final Object p5) {
2399        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4, p5);
2400    }
2401
2402    @Override
2403    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2404            final Object p4, final Object p5, final Object p6) {
2405        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4, p5, p6);
2406    }
2407
2408    @Override
2409    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2410            final Object p4, final Object p5, final Object p6, final Object p7) {
2411        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
2412    }
2413
2414    @Override
2415    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2416            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
2417        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
2418    }
2419
2420    @Override
2421    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2422            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8, final Object p9) {
2423        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
2424    }
2425
2426    @Override
2427    public EntryMessage traceEntry() {
2428        return enter(FQCN, null, (Object[]) null);
2429    }
2430
2431    @Override
2432    public EntryMessage traceEntry(final String format, final Object... params) {
2433        return enter(FQCN, format, params);
2434    }
2435
2436    @Override
2437    public EntryMessage traceEntry(final Supplier<?>... paramSuppliers) {
2438        return enter(FQCN, null, paramSuppliers);
2439    }
2440
2441    @Override
2442    public EntryMessage traceEntry(final String format, final Supplier<?>... paramSuppliers) {
2443        return enter(FQCN, format, paramSuppliers);
2444    }
2445
2446    @Override
2447    public EntryMessage traceEntry(final Message message) {
2448        return enter(FQCN, message);
2449    }
2450
2451    @Override
2452    public void traceExit() {
2453        exit(FQCN, null, null);
2454    }
2455
2456    @Override
2457    public <R> R traceExit(final R result) {
2458        return exit(FQCN, null, result);
2459    }
2460
2461    @Override
2462    public <R> R traceExit(final String format, final R result) {
2463        return exit(FQCN, format, result);
2464    }
2465
2466    @Override
2467    public void traceExit(final EntryMessage message) {
2468        // If the message is null, traceEnter returned null because flow logging was disabled, we can optimize out calling isEnabled().
2469        if (message != null && isEnabled(Level.TRACE, EXIT_MARKER, message, null)) {
2470            logMessageSafely(FQCN, Level.TRACE, EXIT_MARKER, flowMessageFactory.newExitMessage(message), null);
2471        }
2472    }
2473
2474    @Override
2475    public <R> R traceExit(final EntryMessage message, final R result) {
2476        // If the message is null, traceEnter returned null because flow logging was disabled, we can optimize out calling isEnabled().
2477        if (message != null && isEnabled(Level.TRACE, EXIT_MARKER, message, null)) {
2478            logMessageSafely(FQCN, Level.TRACE, EXIT_MARKER, flowMessageFactory.newExitMessage(result, message), null);
2479        }
2480        return result;
2481    }
2482
2483    @Override
2484    public <R> R traceExit(final Message message, final R result) {
2485        // If the message is null, traceEnter returned null because flow logging was disabled, we can optimize out calling isEnabled().
2486        if (message != null && isEnabled(Level.TRACE, EXIT_MARKER, message, null)) {
2487            logMessageSafely(FQCN, Level.TRACE, EXIT_MARKER, flowMessageFactory.newExitMessage(result, message), null);
2488        }
2489        return result;
2490    }
2491
2492    @Override
2493    public void warn(final Marker marker, final Message msg) {
2494        logIfEnabled(FQCN, Level.WARN, marker, msg, msg != null ? msg.getThrowable() : null);
2495    }
2496
2497    @Override
2498    public void warn(final Marker marker, final Message msg, final Throwable t) {
2499        logIfEnabled(FQCN, Level.WARN, marker, msg, t);
2500    }
2501
2502    @Override
2503    public void warn(final Marker marker, final CharSequence message) {
2504        logIfEnabled(FQCN, Level.WARN, marker, message, null);
2505    }
2506
2507    @Override
2508    public void warn(final Marker marker, final CharSequence message, final Throwable t) {
2509        logIfEnabled(FQCN, Level.WARN, marker, message, t);
2510    }
2511
2512    @Override
2513    public void warn(final Marker marker, final Object message) {
2514        logIfEnabled(FQCN, Level.WARN, marker, message, null);
2515    }
2516
2517    @Override
2518    public void warn(final Marker marker, final Object message, final Throwable t) {
2519        logIfEnabled(FQCN, Level.WARN, marker, message, t);
2520    }
2521
2522    @Override
2523    public void warn(final Marker marker, final String message) {
2524        logIfEnabled(FQCN, Level.WARN, marker, message, (Throwable) null);
2525    }
2526
2527    @Override
2528    public void warn(final Marker marker, final String message, final Object... params) {
2529        logIfEnabled(FQCN, Level.WARN, marker, message, params);
2530    }
2531
2532    @Override
2533    public void warn(final Marker marker, final String message, final Throwable t) {
2534        logIfEnabled(FQCN, Level.WARN, marker, message, t);
2535    }
2536
2537    @Override
2538    public void warn(final Message msg) {
2539        logIfEnabled(FQCN, Level.WARN, null, msg, msg != null ? msg.getThrowable() : null);
2540    }
2541
2542    @Override
2543    public void warn(final Message msg, final Throwable t) {
2544        logIfEnabled(FQCN, Level.WARN, null, msg, t);
2545    }
2546
2547    @Override
2548    public void warn(final CharSequence message) {
2549        logIfEnabled(FQCN, Level.WARN, null, message, null);
2550    }
2551
2552    @Override
2553    public void warn(final CharSequence message, final Throwable t) {
2554        logIfEnabled(FQCN, Level.WARN, null, message, t);
2555    }
2556
2557    @Override
2558    public void warn(final Object message) {
2559        logIfEnabled(FQCN, Level.WARN, null, message, null);
2560    }
2561
2562    @Override
2563    public void warn(final Object message, final Throwable t) {
2564        logIfEnabled(FQCN, Level.WARN, null, message, t);
2565    }
2566
2567    @Override
2568    public void warn(final String message) {
2569        logIfEnabled(FQCN, Level.WARN, null, message, (Throwable) null);
2570    }
2571
2572    @Override
2573    public void warn(final String message, final Object... params) {
2574        logIfEnabled(FQCN, Level.WARN, null, message, params);
2575    }
2576
2577    @Override
2578    public void warn(final String message, final Throwable t) {
2579        logIfEnabled(FQCN, Level.WARN, null, message, t);
2580    }
2581
2582    @Override
2583    public void warn(final Supplier<?> msgSupplier) {
2584        logIfEnabled(FQCN, Level.WARN, null, msgSupplier, (Throwable) null);
2585    }
2586
2587    @Override
2588    public void warn(final Supplier<?> msgSupplier, final Throwable t) {
2589        logIfEnabled(FQCN, Level.WARN, null, msgSupplier, t);
2590    }
2591
2592    @Override
2593    public void warn(final Marker marker, final Supplier<?> msgSupplier) {
2594        logIfEnabled(FQCN, Level.WARN, marker, msgSupplier, (Throwable) null);
2595    }
2596
2597    @Override
2598    public void warn(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
2599        logIfEnabled(FQCN, Level.WARN, marker, message, paramSuppliers);
2600    }
2601
2602    @Override
2603    public void warn(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
2604        logIfEnabled(FQCN, Level.WARN, marker, msgSupplier, t);
2605    }
2606
2607    @Override
2608    public void warn(final String message, final Supplier<?>... paramSuppliers) {
2609        logIfEnabled(FQCN, Level.WARN, null, message, paramSuppliers);
2610    }
2611
2612    @Override
2613    public void warn(final Marker marker, final MessageSupplier msgSupplier) {
2614        logIfEnabled(FQCN, Level.WARN, marker, msgSupplier, (Throwable) null);
2615    }
2616
2617    @Override
2618    public void warn(final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
2619        logIfEnabled(FQCN, Level.WARN, marker, msgSupplier, t);
2620    }
2621
2622    @Override
2623    public void warn(final MessageSupplier msgSupplier) {
2624        logIfEnabled(FQCN, Level.WARN, null, msgSupplier, (Throwable) null);
2625    }
2626
2627    @Override
2628    public void warn(final MessageSupplier msgSupplier, final Throwable t) {
2629        logIfEnabled(FQCN, Level.WARN, null, msgSupplier, t);
2630    }
2631
2632    @Override
2633    public void warn(final Marker marker, final String message, final Object p0) {
2634        logIfEnabled(FQCN, Level.WARN, marker, message, p0);
2635    }
2636
2637    @Override
2638    public void warn(final Marker marker, final String message, final Object p0, final Object p1) {
2639        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1);
2640    }
2641
2642    @Override
2643    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2) {
2644        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2);
2645    }
2646
2647    @Override
2648    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2649            final Object p3) {
2650        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3);
2651    }
2652
2653    @Override
2654    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2655            final Object p3, final Object p4) {
2656        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4);
2657    }
2658
2659    @Override
2660    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2661            final Object p3, final Object p4, final Object p5) {
2662        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4, p5);
2663    }
2664
2665    @Override
2666    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2667            final Object p3, final Object p4, final Object p5, final Object p6) {
2668        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4, p5, p6);
2669    }
2670
2671    @Override
2672    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2673            final Object p3, final Object p4, final Object p5, final Object p6, final Object p7) {
2674        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
2675    }
2676
2677    @Override
2678    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2679            final Object p3, final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
2680        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
2681    }
2682
2683    @Override
2684    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2685            final Object p3, final Object p4, final Object p5,
2686            final Object p6, final Object p7, final Object p8, final Object p9) {
2687        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
2688    }
2689
2690    @Override
2691    public void warn(final String message, final Object p0) {
2692        logIfEnabled(FQCN, Level.WARN, null, message, p0);
2693    }
2694
2695    @Override
2696    public void warn(final String message, final Object p0, final Object p1) {
2697        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1);
2698    }
2699
2700    @Override
2701    public void warn(final String message, final Object p0, final Object p1, final Object p2) {
2702        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2);
2703    }
2704
2705    @Override
2706    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
2707        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3);
2708    }
2709
2710    @Override
2711    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2712            final Object p4) {
2713        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4);
2714    }
2715
2716    @Override
2717    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2718            final Object p4, final Object p5) {
2719        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4, p5);
2720    }
2721
2722    @Override
2723    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2724            final Object p4, final Object p5, final Object p6) {
2725        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4, p5, p6);
2726    }
2727
2728    @Override
2729    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2730            final Object p4, final Object p5, final Object p6, final Object p7) {
2731        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
2732    }
2733
2734    @Override
2735    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2736            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
2737        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
2738    }
2739
2740    @Override
2741    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2742            final Object p4, final Object p5, final Object p6,
2743            final Object p7, final Object p8, final Object p9) {
2744        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
2745    }
2746}