View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements. See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache license, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License. You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the license for the specific language governing permissions and
15   * limitations under the license.
16   */
17  package org.apache.logging.log4j.spi;
18  
19  import org.apache.logging.log4j.Level;
20  import org.apache.logging.log4j.Logger;
21  import org.apache.logging.log4j.Marker;
22  import org.apache.logging.log4j.MarkerManager;
23  import org.apache.logging.log4j.message.Message;
24  import org.apache.logging.log4j.message.ObjectMessage;
25  import org.apache.logging.log4j.message.ParameterizedMessage;
26  import org.apache.logging.log4j.message.SimpleMessage;
27  
28  /**
29   * Base implementation of a Logger. It is highly recommended that any Logger implementation extend this class.
30   *
31   * @doubt See Jira LOG4J2-39.
32   */
33  public abstract class AbstractLogger implements Logger {
34  
35      /**
36       * Marker for flow tracing.
37       */
38      public static final Marker FLOW_MARKER = MarkerManager.getMarker("FLOW");
39      /**
40       * Marker for method entry tracing.
41       */
42      public static final Marker ENTRY_MARKER = MarkerManager.getMarker("ENTRY", FLOW_MARKER);
43      /**
44       * Marker for method exit tracing.
45       */
46      public static final Marker EXIT_MARKER = MarkerManager.getMarker("EXIT", FLOW_MARKER);
47      /**
48       * Marker for exception tracing.
49       */
50      public static final Marker EXCEPTION_MARKER = MarkerManager.getMarker("EXCEPTION");
51      /**
52       * Marker for throwing exceptions.
53       */
54      public static final Marker THROWING_MARKER = MarkerManager.getMarker("THROWING", EXCEPTION_MARKER);
55      /**
56       * Marker for catching exceptions.
57       */
58      public static final Marker CATCHING_MARKER = MarkerManager.getMarker("CATCHING", EXCEPTION_MARKER);
59  
60      private static final String FQCN = AbstractLogger.class.getName();
61  
62      /**
63       * Log entry to a method.
64       */
65      public void entry() {
66          if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
67              log(ENTRY_MARKER, FQCN, Level.TRACE, new SimpleMessage(" entry"), null);
68          }
69      }
70  
71  
72      /**
73       * Log entry to a method.
74       *
75       * @param params The parameters to the method.
76       */
77      public void entry(Object... params) {
78          if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
79              log(ENTRY_MARKER, FQCN, Level.TRACE, entryMsg(params.length, params), null);
80          }
81      }
82  
83      /**
84       * Log exit from a method.
85       */
86      public void exit() {
87          if (isEnabled(Level.TRACE, EXIT_MARKER, (Object) null, null)) {
88              log(EXIT_MARKER, FQCN, Level.TRACE, exitMsg(null), null);
89          }
90      }
91  
92      /**
93       * Log exiting from a method with the result.
94       *
95       * @param result The result being returned from the method call.
96       * @return the Throwable.
97       */
98      public <R> R exit(R result) {
99          if (isEnabled(Level.TRACE, EXIT_MARKER, (Object) null, null)) {
100             log(EXIT_MARKER, FQCN, Level.TRACE, exitMsg(result), null);
101         }
102         return result;
103     }
104 
105     /**
106      * Log an exception or error to be thrown.
107      *
108      * @param t The Throwable.
109      * @return the Throwable.
110      */
111     public <T extends Throwable> T throwing(T t) {
112         if (isEnabled(Level.ERROR, THROWING_MARKER, (Object) null, null)) {
113             log(THROWING_MARKER, FQCN, Level.ERROR, new SimpleMessage("throwing"), t);
114         }
115         return t;
116     }
117 
118 
119     /**
120      * Log an exception or error to be thrown.
121      *
122      * @param level The logging Level.
123      * @param t     The Throwable.
124      * @return the Throwable.
125      */
126     public <T extends Throwable> T throwing(Level level, T t) {
127         if (isEnabled(level, THROWING_MARKER, (Object) null, null)) {
128             log(THROWING_MARKER, FQCN, level, new SimpleMessage("throwing"), t);
129         }
130         return t;
131     }
132 
133     /**
134      * Log an exception or error that has been caught.
135      *
136      * @param t The Throwable.
137      */
138     public void catching(Throwable t) {
139         if (isEnabled(Level.DEBUG, THROWING_MARKER, (Object) null, null)) {
140             log(THROWING_MARKER, FQCN, Level.DEBUG, new SimpleMessage("catching"), t);
141         }
142     }
143 
144     /**
145      * Log an exception or error that has been caught.
146      *
147      * @param level The logging Level.
148      * @param t     The Throwable.
149      */
150     public void catching(Level level, Throwable t) {
151         if (isEnabled(level, THROWING_MARKER, (Object) null, null)) {
152             log(THROWING_MARKER, FQCN, level, new SimpleMessage("catching"), t);
153         }
154     }
155 
156     /**
157      * Log a message object with the {@link org.apache.logging.log4j.Level#TRACE TRACE} level.
158      *
159      * @param message the message object to log.
160      */
161     public void trace(String message) {
162         if (isEnabled(Level.TRACE, null, message)) {
163             log(null, FQCN, Level.TRACE, new SimpleMessage(message), null);
164         }
165     }
166 
167     /**
168      * Log a message object with the {@link org.apache.logging.log4j.Level#TRACE TRACE} level.
169      *
170      * @param marker the marker data specific to this log statement.
171      * @param message the message object to log.
172      */
173     public void trace(Marker marker, String message) {
174         if (isEnabled(Level.TRACE, marker, message)) {
175             log(marker, FQCN, Level.TRACE, new SimpleMessage(message), null);
176         }
177     }
178 
179     /**
180      * Log a message at the <code>TRACE</code> level including the
181      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
182      * <p/>
183      * <p>
184      * See {@link #debug(String)} form for more detailed information.
185      * </p>
186      *
187      * @param message the message object to log.
188      * @param t       the exception to log, including its stack trace.
189      */
190     public void trace(String message, Throwable t) {
191         if (isEnabled(Level.TRACE, null, message, t)) {
192             log(null, FQCN, Level.TRACE, new SimpleMessage(message), t);
193         }
194     }
195 
196 
197     /**
198      * Log a message at the <code>TRACE</code> level including the
199      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
200      * <p/>
201      * <p>
202      * See {@link #debug(String)} form for more detailed information.
203      * </p>
204      *
205      * @param marker the marker data specific to this log statement.
206      * @param message the message object to log.
207      * @param t       the exception to log, including its stack trace.
208      */
209     public void trace(Marker marker, String message, Throwable t) {
210         if (isEnabled(Level.TRACE, marker, message, t)) {
211             log(marker, FQCN, Level.TRACE, new SimpleMessage(message), t);
212         }
213     }
214 
215     /**
216      * Log a message object with the {@link org.apache.logging.log4j.Level#TRACE TRACE} level.
217      *
218      * @param message the message object to log.
219      */
220     public void trace(Object message) {
221         if (isEnabled(Level.TRACE, null, message, null)) {
222             log(null, FQCN, Level.TRACE, new ObjectMessage(message), null);
223         }
224     }
225 
226     /**
227      * Log a message object with the {@link org.apache.logging.log4j.Level#TRACE TRACE} level.
228      *
229      * @param marker the marker data specific to this log statement.
230      * @param message the message object to log.
231      */
232     public void trace(Marker marker, Object message) {
233         if (isEnabled(Level.TRACE, marker, message, null)) {
234             log(marker, FQCN, Level.TRACE, new ObjectMessage(message), null);
235         }
236     }
237 
238     /**
239      * Log a message at the <code>TRACE</code> level including the
240      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
241      * <p/>
242      * <p>
243      * See {@link #debug(String)} form for more detailed information.
244      * </p>
245      *
246      * @param message the message object to log.
247      * @param t       the exception to log, including its stack trace.
248      */
249     public void trace(Object message, Throwable t) {
250         if (isEnabled(Level.TRACE, null, message, t)) {
251             log(null, FQCN, Level.TRACE, new ObjectMessage(message), t);
252         }
253     }
254 
255     /**
256      * Log a message at the <code>TRACE</code> level including the
257      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
258      * <p/>
259      * <p>
260      * See {@link #debug(String)} form for more detailed information.
261      * </p>
262      *
263      * @param marker the marker data specific to this log statement.
264      * @param message the message object to log.
265      * @param t       the exception to log, including its stack trace.
266      */
267     public void trace(Marker marker, Object message, Throwable t) {
268         if (isEnabled(Level.TRACE, marker, message, t)) {
269             log(marker, FQCN, Level.TRACE, new ObjectMessage(message), t);
270         }
271     }
272 
273     /**
274      * Log a message with parameters at the <code>TRACE</code> level.
275      *
276      * @param message the message to log.
277      * @param params  parameters to the message.
278      */
279     public void trace(String message, Object... params) {
280         if (isEnabled(Level.TRACE, null, message, params)) {
281             ParameterizedMessage msg = new ParameterizedMessage(message, params);
282             log(null, FQCN, Level.TRACE, msg, msg.getThrowable());
283         }
284     }
285 
286     /**
287      * Log a message with parameters at the <code>TRACE</code> level.
288      *
289      * @param marker the marker data specific to this log statement.
290      * @param message the message to log.
291      * @param params  parameters to the message.
292      */
293     public void trace(Marker marker, String message, Object... params) {
294         if (isEnabled(Level.TRACE, marker, message, params)) {
295             ParameterizedMessage msg = new ParameterizedMessage(message, params);
296             log(marker, FQCN, Level.TRACE, msg, msg.getThrowable());
297         }
298     }
299 
300     /**
301      * Check whether this Logger is enabled for the TRACE  Level.
302      *
303      * @return boolean - <code>true</code> if this Logger is enabled for level
304      *         TRACE, <code>false</code> otherwise.
305      */
306     public boolean isTraceEnabled() {
307         return isEnabled(Level.TRACE, null, (Object) null, null);
308     }
309 
310     /**
311      * Check whether this Logger is enabled for the TRACE  Level.
312      *
313      * @param marker The marker data.
314      * @return boolean - <code>true</code> if this Logger is enabled for level
315      *         TRACE, <code>false</code> otherwise.
316      */
317     public boolean isTraceEnabled(Marker marker) {
318         return isEnabled(Level.TRACE, marker, (Object) null, null);
319     }
320 
321     /**
322      * Log a message with the specific Marker at the TRACE level.
323      *
324      * @param msg the message string to be logged
325      */
326     public void trace(Message msg) {
327         if (isEnabled(Level.TRACE, null, msg, null)) {
328             log(null, FQCN, Level.TRACE, msg, null);
329         }
330     }
331 
332     /**
333      * Log a message with the specific Marker at the TRACE level.
334      *
335      * @param msg the message string to be logged
336      * @param t   A Throwable or null.
337      */
338     public void trace(Message msg, Throwable t) {
339         if (isEnabled(Level.TRACE, null, msg, t)) {
340             log(null, FQCN, Level.TRACE, msg, t);
341         }
342     }
343 
344     /**
345      * Log a message with the specific Marker at the TRACE level.
346      *
347      * @param marker the marker data specific to this log statement.
348      * @param msg    the message string to be logged
349      */
350     public void trace(Marker marker, Message msg) {
351         if (isEnabled(Level.TRACE, marker, msg, null)) {
352             log(marker, FQCN, Level.TRACE, msg, null);
353         }
354     }
355 
356     /**
357      * Log a message with the specific Marker at the TRACE level.
358      *
359      * @param marker the marker data specific to this log statement.
360      * @param msg    the message string to be logged
361      * @param t      A Throwable or null.
362      */
363     public void trace(Marker marker, Message msg, Throwable t) {
364         if (isEnabled(Level.TRACE, marker, msg, t)) {
365             log(marker, FQCN, Level.TRACE, msg, t);
366         }
367     }
368 
369     /**
370      * Log a message object with the {@link org.apache.logging.log4j.Level#DEBUG DEBUG} level.
371      *
372      * @param message the message object to log.
373      */
374     public void debug(String message) {
375         if (isEnabled(Level.DEBUG, null, message)) {
376             log(null, FQCN, Level.DEBUG, new SimpleMessage(message), null);
377         }
378     }
379 
380     /**
381      * Log a message object with the {@link org.apache.logging.log4j.Level#DEBUG DEBUG} level.
382      *
383      * @param marker the marker data specific to this log statement.
384      * @param message the message object to log.
385      */
386     public void debug(Marker marker, String message) {
387         if (isEnabled(Level.DEBUG, marker, message)) {
388             log(marker, FQCN, Level.DEBUG, new SimpleMessage(message), null);
389         }
390     }
391 
392     /**
393      * Log a message at the <code>DEBUG</code> level including the
394      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
395      *
396      * @param message the message to log.
397      * @param t       the exception to log, including its stack trace.
398      */
399     public void debug(String message, Throwable t) {
400         if (isEnabled(Level.DEBUG, null, message, t)) {
401             log(null, FQCN, Level.DEBUG, new SimpleMessage(message), t);
402         }
403     }
404 
405     /**
406      * Log a message at the <code>DEBUG</code> level including the
407      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
408      *
409      * @param marker the marker data specific to this log statement.
410      * @param message the message to log.
411      * @param t       the exception to log, including its stack trace.
412      */
413     public void debug(Marker marker, String message, Throwable t) {
414         if (isEnabled(Level.DEBUG, marker, message, t)) {
415             log(marker, FQCN, Level.DEBUG, new SimpleMessage(message), t);
416         }
417     }
418     /**
419      * Log a message object with the {@link org.apache.logging.log4j.Level#DEBUG DEBUG} level.
420      *
421      * @param message the message object to log.
422      */
423     public void debug(Object message) {
424         if (isEnabled(Level.DEBUG, null, message, null)) {
425             log(null, FQCN, Level.DEBUG, new ObjectMessage(message), null);
426         }
427     }
428 
429     /**
430      * Log a message object with the {@link org.apache.logging.log4j.Level#DEBUG DEBUG} level.
431      *
432      * @param marker the marker data specific to this log statement.
433      * @param message the message object to log.
434      */
435     public void debug(Marker marker, Object message) {
436         if (isEnabled(Level.DEBUG, marker, message, null)) {
437             log(marker, FQCN, Level.DEBUG, new ObjectMessage(message), null);
438         }
439     }
440 
441     /**
442      * Log a message at the <code>DEBUG</code> level including the
443      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
444      *
445      * @param message the message to log.
446      * @param t       the exception to log, including its stack trace.
447      */
448     public void debug(Object message, Throwable t) {
449         if (isEnabled(Level.DEBUG, null, message, t)) {
450             log(null, FQCN, Level.DEBUG, new ObjectMessage(message), t);
451         }
452     }
453 
454     /**
455      * Log a message at the <code>DEBUG</code> level including the
456      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
457      *
458      * @param marker the marker data specific to this log statement.
459      * @param message the message to log.
460      * @param t       the exception to log, including its stack trace.
461      */
462     public void debug(Marker marker, Object message, Throwable t) {
463         if (isEnabled(Level.DEBUG, marker, message, t)) {
464             log(marker, FQCN, Level.DEBUG, new ObjectMessage(message), t);
465         }
466     }
467 
468     /**
469      * Log a message with parameters at the <code>DEBUG</code> level.
470      *
471      * @param message the message to log.
472      * @param params  parameters to the message.
473      */
474     public void debug(String message, Object... params) {
475         if (isEnabled(Level.DEBUG, null, message, params)) {
476             ParameterizedMessage msg = new ParameterizedMessage(message, params);
477             log(null, FQCN, Level.DEBUG, msg, msg.getThrowable());
478         }
479     }
480 
481     /**
482      * Log a message with parameters at the <code>DEBUG</code> level.
483      *
484      * @param marker the marker data specific to this log statement.
485      * @param message the message to log.
486      * @param params  parameters to the message.
487      */
488     public void debug(Marker marker, String message, Object... params) {
489         if (isEnabled(Level.DEBUG, marker, message, params)) {
490             ParameterizedMessage msg = new ParameterizedMessage(message, params);
491             log(marker, FQCN, Level.DEBUG, msg, msg.getThrowable());
492         }
493     }
494 
495     /**
496      * Check whether this Logger is enabled for the DEBUG Level.
497      *
498      * @return boolean - <code>true</code> if this Logger is enabled for level
499      *         DEBUG, <code>false</code> otherwise.
500      */
501     public boolean isDebugEnabled() {
502         return isEnabled(Level.DEBUG, null, null);
503     }
504 
505     /**
506      * Check whether this Logger is enabled for the DEBUG Level.
507      *
508      * @param marker The marker data.
509      * @return boolean - <code>true</code> if this Logger is enabled for level
510      *         DEBUG, <code>false</code> otherwise.
511      */
512     public boolean isDebugEnabled(Marker marker) {
513         return isEnabled(Level.DEBUG, marker, (Object) null, null);
514     }
515 
516     /**
517      * Log a message with the specific Marker at the DEBUG level.
518      *
519      * @param msg the message string to be logged
520      */
521     public void debug(Message msg) {
522         if (isEnabled(Level.TRACE, null, msg, null)) {
523             log(null, FQCN, Level.TRACE, msg, null);
524         }
525     }
526 
527     /**
528      * Log a message with the specific Marker at the DEBUG level.
529      *
530      * @param msg the message string to be logged
531      * @param t   A Throwable or null.
532      */
533     public void debug(Message msg, Throwable t) {
534         if (isEnabled(Level.TRACE, null, msg, t)) {
535             log(null, FQCN, Level.TRACE, msg, t);
536         }
537     }
538 
539     /**
540      * Log a message with the specific Marker at the DEBUG level.
541      *
542      * @param marker the marker data specific to this log statement
543      * @param msg    the message string to be logged
544      */
545     public void debug(Marker marker, Message msg) {
546         if (isEnabled(Level.DEBUG, marker, msg, null)) {
547             log(marker, FQCN, Level.DEBUG, msg, null);
548         }
549     }
550 
551     /**
552      * Log a message with the specific Marker at the DEBUG level.
553      *
554      * @param marker the marker data specific to this log statement.
555      * @param msg    the message string to be logged
556      * @param t      A Throwable or null.
557      */
558     public void debug(Marker marker, Message msg, Throwable t) {
559         if (isEnabled(Level.DEBUG, marker, msg, t)) {
560             log(marker, FQCN, Level.DEBUG, msg, t);
561         }
562     }
563 
564     /**
565      * Log a message object with the {@link org.apache.logging.log4j.Level#INFO INFO} level.
566      *
567      * @param message the message object to log.
568      */
569     public void info(String message) {
570         if (isEnabled(Level.INFO, null, message)) {
571             log(null, FQCN, Level.INFO, new SimpleMessage(message), null);
572         }
573     }
574 
575     /**
576      * Log a message object with the {@link org.apache.logging.log4j.Level#INFO INFO} level.
577      *
578      * @param marker the marker data specific to this log statement.
579      * @param message the message object to log.
580      */
581     public void info(Marker marker, String message) {
582         if (isEnabled(Level.INFO, marker, message)) {
583             log(marker, FQCN, Level.INFO, new SimpleMessage(message), null);
584         }
585     }
586 
587     /**
588      * Log a message at the <code>INFO</code> level including the
589      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
590      *
591      * @param message the message object to log.
592      * @param t       the exception to log, including its stack trace.
593      */
594     public void info(String message, Throwable t) {
595         if (isEnabled(Level.INFO, null, message, t)) {
596             log(null, FQCN, Level.INFO, new SimpleMessage(message), t);
597         }
598     }
599 
600     /**
601      * Log a message at the <code>INFO</code> level including the
602      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
603      *
604      * @param marker the marker data specific to this log statement.
605      * @param message the message object to log.
606      * @param t       the exception to log, including its stack trace.
607      */
608     public void info(Marker marker, String message, Throwable t) {
609         if (isEnabled(Level.INFO, marker, message, t)) {
610             log(marker, FQCN, Level.INFO, new SimpleMessage(message), t);
611         }
612     }
613 
614     /**
615      * Log a message object with the {@link org.apache.logging.log4j.Level#INFO INFO} level.
616      *
617      * @param message the message object to log.
618      */
619     public void info(Object message) {
620         if (isEnabled(Level.INFO, null, message, null)) {
621             log(null, FQCN, Level.INFO, new ObjectMessage(message), null);
622         }
623     }
624 
625     /**
626      * Log a message object with the {@link org.apache.logging.log4j.Level#INFO INFO} level.
627      *
628      * @param marker the marker data specific to this log statement.
629      * @param message the message object to log.
630      */
631     public void info(Marker marker, Object message) {
632         if (isEnabled(Level.INFO, marker, message, null)) {
633             log(marker, FQCN, Level.INFO, new ObjectMessage(message), null);
634         }
635     }
636 
637     /**
638      * Log a message at the <code>INFO</code> level including the
639      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
640      *
641      * @param message the message object to log.
642      * @param t       the exception to log, including its stack trace.
643      */
644     public void info(Object message, Throwable t) {
645         if (isEnabled(Level.INFO, null, message, t)) {
646             log(null, FQCN, Level.INFO, new ObjectMessage(message), t);
647         }
648     }
649 
650 
651     /**
652      * Log a message at the <code>INFO</code> level including the
653      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
654      *
655      * @param marker the marker data specific to this log statement.
656      * @param message the message object to log.
657      * @param t       the exception to log, including its stack trace.
658      */
659     public void info(Marker marker, Object message, Throwable t) {
660         if (isEnabled(Level.INFO, marker, message, t)) {
661             log(marker, FQCN, Level.INFO, new ObjectMessage(message), t);
662         }
663     }
664 
665     /**
666      * Log a message with parameters at the <code>INFO</code> level.
667      *
668      * @param message the message to log.
669      * @param params  parameters to the message.
670      */
671     public void info(String message, Object... params) {
672         if (isEnabled(Level.INFO, null, message, params)) {
673             ParameterizedMessage msg = new ParameterizedMessage(message, params);
674             log(null, FQCN, Level.INFO, msg, msg.getThrowable());
675         }
676     }
677 
678     /**
679      * Log a message with parameters at the <code>INFO</code> level.
680      *
681      * @param marker the marker data specific to this log statement.
682      * @param message the message to log.
683      * @param params  parameters to the message.
684      */
685     public void info(Marker marker, String message, Object... params) {
686         if (isEnabled(Level.INFO, marker, message, params)) {
687             ParameterizedMessage msg = new ParameterizedMessage(message, params);
688             log(marker, FQCN, Level.INFO, msg, msg.getThrowable());
689         }
690     }
691 
692     /**
693      * Check whether this Logger is enabled for the INFO Level.
694      *
695      * @return boolean - <code>true</code> if this Logger is enabled for level
696      *         INFO, <code>false</code> otherwise.
697      */
698     public boolean isInfoEnabled() {
699         return isEnabled(Level.INFO, null, (Object) null, null);
700     }
701 
702     /**
703      * Check whether this Logger is enabled for the INFO Level.
704      * @param marker The marker data.
705      * @return boolean - <code>true</code> if this Logger is enabled for level
706      *         INFO, <code>false</code> otherwise.
707      */
708     public boolean isInfoEnabled(Marker marker) {
709         return isEnabled(Level.INFO, marker, (Object) null, null);
710     }
711 
712     /**
713      * Log a message with the specific Marker at the TRACE level.
714      *
715      * @param msg the message string to be logged
716      */
717     public void info(Message msg) {
718         if (isEnabled(Level.INFO, null, msg, null)) {
719             log(null, FQCN, Level.INFO, msg, null);
720         }
721     }
722 
723     /**
724      * Log a message with the specific Marker at the INFO level.
725      *
726      * @param msg the message string to be logged
727      * @param t   A Throwable or null.
728      */
729     public void info(Message msg, Throwable t) {
730         if (isEnabled(Level.INFO, null, msg, t)) {
731             log(null, FQCN, Level.INFO, msg, t);
732         }
733     }
734 
735     /**
736      * Log a message with the specific Marker at the INFO level.
737      *
738      * @param marker the marker data specific to this log statement
739      * @param msg    the message string to be logged
740      */
741     public void info(Marker marker, Message msg) {
742         if (isEnabled(Level.INFO, null, msg, null)) {
743             log(marker, FQCN, Level.INFO, msg, null);
744         }
745     }
746 
747     /**
748      * Log a message with the specific Marker at the INFO level.
749      *
750      * @param marker the marker data specific to this log statement
751      * @param msg    the message string to be logged
752      * @param t      A Throwable or null.
753      */
754     public void info(Marker marker, Message msg, Throwable t) {
755         if (isEnabled(Level.INFO, marker, msg, t)) {
756             log(marker, FQCN, Level.INFO, msg, t);
757         }
758     }
759 
760     /**
761      * Log a message object with the {@link org.apache.logging.log4j.Level#WARN WARN} level.
762      *
763      * @param message the message object to log.
764      */
765     public void warn(String message) {
766         if (isEnabled(Level.WARN, null, message)) {
767             log(null, FQCN, Level.WARN, new SimpleMessage(message), null);
768         }
769     }
770 
771     /**
772      * Log a message object with the {@link org.apache.logging.log4j.Level#WARN WARN} level.
773      *
774      * @param marker the marker data specific to this log statement.
775      * @param message the message object to log.
776      */
777     public void warn(Marker marker, String message) {
778         if (isEnabled(Level.WARN, marker, message)) {
779             log(marker, FQCN, Level.WARN, new SimpleMessage(message), null);
780         }
781     }
782 
783     /**
784      * Log a message at the <code>WARN</code> level including the
785      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
786      *
787      * @param message the message object to log.
788      * @param t       the exception to log, including its stack trace.
789      */
790     public void warn(String message, Throwable t) {
791         if (isEnabled(Level.WARN, null, message, t)) {
792             log(null, FQCN, Level.DEBUG, new SimpleMessage(message), t);
793         }
794     }
795 
796     /**
797      * Log a message at the <code>WARN</code> level including the
798      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
799      *
800      * @param marker the marker data specific to this log statement.
801      * @param message the message object to log.
802      * @param t       the exception to log, including its stack trace.
803      */
804     public void warn(Marker marker, String message, Throwable t) {
805         if (isEnabled(Level.WARN, marker, message, t)) {
806             log(marker, FQCN, Level.DEBUG, new SimpleMessage(message), t);
807         }
808     }
809 
810     /**
811      * Log a message object with the {@link org.apache.logging.log4j.Level#WARN WARN} level.
812      *
813      * @param marker the marker data specific to this log statement.
814      * @param message the message object to log.
815      */
816     public void warn(Marker marker, Object message) {
817         if (isEnabled(Level.WARN, marker, message, null)) {
818             log(marker, FQCN, Level.WARN, new ObjectMessage(message), null);
819         }
820     }
821 
822     /**
823      * Log a message object with the {@link org.apache.logging.log4j.Level#WARN WARN} level.
824      *
825      * @param message the message object to log.
826      */
827     public void warn(Object message) {
828         if (isEnabled(Level.WARN, null, message, null)) {
829             log(null, FQCN, Level.WARN, new ObjectMessage(message), null);
830         }
831     }
832 
833     /**
834      * Log a message at the <code>WARN</code> level including the
835      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
836      *
837      * @param message the message object to log.
838      * @param t       the exception to log, including its stack trace.
839      */
840     public void warn(Object message, Throwable t) {
841         if (isEnabled(Level.WARN, null, message, t)) {
842             log(null, FQCN, Level.DEBUG, new ObjectMessage(message), t);
843         }
844     }
845 
846     /**
847      * Log a message at the <code>WARN</code> level including the
848      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
849      *
850      * @param marker the marker data specific to this log statement.
851      * @param message the message object to log.
852      * @param t       the exception to log, including its stack trace.
853      */
854     public void warn(Marker marker, Object message, Throwable t) {
855         if (isEnabled(Level.WARN, marker, message, t)) {
856             log(marker, FQCN, Level.DEBUG, new ObjectMessage(message), t);
857         }
858     }
859 
860     /**
861      * Log a message with parameters at the <code>WARN</code> level.
862      *
863      * @param message the message to log.
864      * @param params  parameters to the message.
865      */
866     public void warn(String message, Object... params) {
867         if (isEnabled(Level.WARN, null, message, params)) {
868             ParameterizedMessage msg = new ParameterizedMessage(message, params);
869             log(null, FQCN, Level.WARN, msg, msg.getThrowable());
870         }
871     }
872 
873     /**
874      * Log a message with parameters at the <code>WARN</code> level.
875      *
876      * @param marker the marker data specific to this log statement.
877      * @param message the message to log.
878      * @param params  parameters to the message.
879      */
880     public void warn(Marker marker, String message, Object... params) {
881         if (isEnabled(Level.WARN, marker, message, params)) {
882             ParameterizedMessage msg = new ParameterizedMessage(message, params);
883             log(marker, FQCN, Level.WARN, msg, msg.getThrowable());
884         }
885     }
886 
887     /**
888      * Check whether this Logger is enabled for the WARN Level.
889      *
890      * @return boolean - <code>true</code> if this Logger is enabled for level
891      *         WARN, <code>false</code> otherwise.
892      */
893     public boolean isWarnEnabled() {
894         return isEnabled(Level.WARN, null, (Object) null, null);
895     }
896 
897     /**
898      * Check whether this Logger is enabled for the WARN Level.
899      *
900      * @param marker The marker data.
901      * @return boolean - <code>true</code> if this Logger is enabled for level
902      *         WARN, <code>false</code> otherwise.
903      */
904     public boolean isWarnEnabled(Marker marker) {
905         return isEnabled(Level.WARN, marker, (Object) null, null);
906     }
907 
908     /**
909      * Log a message with the specific Marker at the WARN level.
910      *
911      * @param msg the message string to be logged
912      */
913     public void warn(Message msg) {
914         if (isEnabled(Level.WARN, null, msg, null)) {
915             log(null, FQCN, Level.WARN, msg, null);
916         }
917     }
918 
919     /**
920      * Log a message with the specific Marker at the WARN level.
921      *
922      * @param msg the message string to be logged
923      * @param t   A Throwable or null.
924      */
925     public void warn(Message msg, Throwable t) {
926         if (isEnabled(Level.WARN, null, msg, t)) {
927             log(null, FQCN, Level.WARN, msg, t);
928         }
929     }
930 
931     /**
932      * Log a message with the specific Marker at the WARN level.
933      *
934      * @param marker the marker data specific to this log statement
935      * @param msg    the message string to be logged
936      */
937     public void warn(Marker marker, Message msg) {
938         if (isEnabled(Level.WARN, null, msg, null)) {
939             log(marker, FQCN, Level.WARN, msg, null);
940         }
941     }
942 
943     /**
944      * Log a message with the specific Marker at the WARN level.
945      *
946      * @param marker the marker data specific to this log statement
947      * @param msg    the message string to be logged
948      * @param t      A Throwable or null.
949      */
950     public void warn(Marker marker, Message msg, Throwable t) {
951         if (isEnabled(Level.WARN, marker, msg, t)) {
952             log(marker, FQCN, Level.WARN, msg, t);
953         }
954     }
955 
956     /**
957      * Log a message object with the {@link org.apache.logging.log4j.Level#ERROR ERROR} level.
958      *
959      * @param message the message object to log.
960      */
961     public void error(String message) {
962         if (isEnabled(Level.ERROR, null, message)) {
963             log(null, FQCN, Level.ERROR, new SimpleMessage(message), null);
964         }
965     }
966 
967     /**
968      * Log a message object with the {@link org.apache.logging.log4j.Level#ERROR ERROR} level.
969      *
970      * @param marker the marker data specific to this log statement.
971      * @param message the message object to log.
972      */
973     public void error(Marker marker, String message) {
974         if (isEnabled(Level.ERROR, marker, message)) {
975             log(marker, FQCN, Level.ERROR, new SimpleMessage(message), null);
976         }
977     }
978 
979     /**
980      * Log a message at the <code>ERROR</code> level including the
981      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
982      *
983      * @param message the message object to log.
984      * @param t       the exception to log, including its stack trace.
985      */
986     public void error(String message, Throwable t) {
987         if (isEnabled(Level.ERROR, null, message, t)) {
988             log(null, FQCN, Level.ERROR, new SimpleMessage(message), t);
989         }
990     }
991 
992     /**
993      * Log a message at the <code>ERROR</code> level including the
994      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
995      *
996      * @param marker the marker data specific to this log statement.
997      * @param message the message object to log.
998      * @param t       the exception to log, including its stack trace.
999      */
1000     public void error(Marker marker, String message, Throwable t) {
1001         if (isEnabled(Level.ERROR, marker, message, t)) {
1002             log(marker, FQCN, Level.ERROR, new SimpleMessage(message), t);
1003         }
1004     }
1005 
1006     /**
1007      * Log a message object with the {@link org.apache.logging.log4j.Level#ERROR ERROR} level.
1008      *
1009      * @param message the message object to log.
1010      */
1011     public void error(Object message) {
1012         if (isEnabled(Level.ERROR, null, message, null)) {
1013             log(null, FQCN, Level.ERROR, new ObjectMessage(message), null);
1014         }
1015     }
1016 
1017     /**
1018      * Log a message object with the {@link org.apache.logging.log4j.Level#ERROR ERROR} level.
1019      *
1020      * @param marker the marker data specific to this log statement.
1021      * @param message the message object to log.
1022      */
1023     public void error(Marker marker, Object message) {
1024         if (isEnabled(Level.ERROR, marker, message, null)) {
1025             log(marker, FQCN, Level.ERROR, new ObjectMessage(message), null);
1026         }
1027     }
1028 
1029     /**
1030      * Log a message at the <code>ERROR</code> level including the
1031      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
1032      *
1033      * @param message the message object to log.
1034      * @param t       the exception to log, including its stack trace.
1035      */
1036     public void error(Object message, Throwable t) {
1037         if (isEnabled(Level.ERROR, null, message, t)) {
1038             log(null, FQCN, Level.ERROR, new ObjectMessage(message), t);
1039         }
1040     }
1041 
1042     /**
1043      * Log a message at the <code>ERROR</code> level including the
1044      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
1045      *
1046      * @param marker the marker data specific to this log statement.
1047      * @param message the message object to log.
1048      * @param t       the exception to log, including its stack trace.
1049      */
1050     public void error(Marker marker, Object message, Throwable t) {
1051         if (isEnabled(Level.ERROR, marker, message, t)) {
1052             log(marker, FQCN, Level.ERROR, new ObjectMessage(message), t);
1053         }
1054     }
1055 
1056     /**
1057      * Log a message with parameters at the <code>ERROR</code> level.
1058      *
1059      * @param message the message to log.
1060      * @param params  parameters to the message.
1061      */
1062     public void error(String message, Object... params) {
1063         if (isEnabled(Level.ERROR, null, message, params)) {
1064             ParameterizedMessage msg = new ParameterizedMessage(message, params);
1065             log(null, FQCN, Level.ERROR, msg, msg.getThrowable());
1066         }
1067     }
1068 
1069     /**
1070      * Log a message with parameters at the <code>ERROR</code> level.
1071      *
1072      * @param marker the marker data specific to this log statement.
1073      * @param message the message to log.
1074      * @param params  parameters to the message.
1075      */
1076     public void error(Marker marker, String message, Object... params) {
1077         if (isEnabled(Level.ERROR, marker, message, params)) {
1078             ParameterizedMessage msg = new ParameterizedMessage(message, params);
1079             log(marker, FQCN, Level.ERROR, msg, msg.getThrowable());
1080         }
1081     }
1082 
1083 
1084     /**
1085      * Check whether this Logger is enabled for the ERROR Level.
1086      *
1087      * @return boolean - <code>true</code> if this Logger is enabled for level
1088      *         ERROR, <code>false</code> otherwise.
1089      */
1090     public boolean isErrorEnabled() {
1091         return isEnabled(Level.ERROR, null, (Object) null, null);
1092     }
1093 
1094     /**
1095      * Check whether this Logger is enabled for the ERROR Level.
1096      *
1097      * @param marker The marker data.
1098      * @return boolean - <code>true</code> if this Logger is enabled for level
1099      *         ERROR, <code>false</code> otherwise.
1100      */
1101     public boolean isErrorEnabled(Marker marker) {
1102         return isEnabled(Level.ERROR, marker, (Object) null, null);
1103     }
1104 
1105     /**
1106      * Log a message with the specific Marker at the ERROR level.
1107      *
1108      * @param msg the message string to be logged
1109      */
1110     public void error(Message msg) {
1111         if (isEnabled(Level.ERROR, null, msg, null)) {
1112             log(null, FQCN, Level.ERROR, msg, null);
1113         }
1114     }
1115 
1116     /**
1117      * Log a message with the specific Marker at the ERROR level.
1118      *
1119      * @param msg the message string to be logged
1120      * @param t   A Throwable or null.
1121      */
1122     public void error(Message msg, Throwable t) {
1123         if (isEnabled(Level.ERROR, null, msg, t)) {
1124             log(null, FQCN, Level.ERROR, msg, t);
1125         }
1126     }
1127 
1128     /**
1129      * Log a message with the specific Marker at the ERROR level.
1130      *
1131      * @param marker the marker data specific to this log statement
1132      * @param msg    the message string to be logged
1133      */
1134     public void error(Marker marker, Message msg) {
1135         if (isEnabled(Level.ERROR, null, msg, null)) {
1136             log(null, FQCN, Level.ERROR, msg, null);
1137         }
1138     }
1139 
1140     /**
1141      * Log a message with the specific Marker at the ERROR level.
1142      *
1143      * @param marker the marker data specific to this log statement
1144      * @param msg    the message string to be logged
1145      * @param t      A Throwable or null.
1146      */
1147     public void error(Marker marker, Message msg, Throwable t) {
1148         if (isEnabled(Level.TRACE, marker, msg, t)) {
1149             log(marker, FQCN, Level.TRACE, msg, t);
1150         }
1151     }
1152 
1153     /**
1154      * Log a message object with the {@link org.apache.logging.log4j.Level#FATAL FATAL} level.
1155      *
1156      * @param message the message object to log.
1157      */
1158     public void fatal(String message) {
1159         if (isEnabled(Level.FATAL, null, message)) {
1160             log(null, FQCN, Level.FATAL, new SimpleMessage(message), null);
1161         }
1162     }
1163 
1164 
1165     /**
1166      * Log a message object with the {@link org.apache.logging.log4j.Level#FATAL FATAL} level.
1167      *
1168      * @param marker the marker data specific to this log statement.
1169      * @param message the message object to log.
1170      */
1171     public void fatal(Marker marker, String message) {
1172         if (isEnabled(Level.FATAL, marker, message)) {
1173             log(marker, FQCN, Level.FATAL, new SimpleMessage(message), null);
1174         }
1175     }
1176 
1177     /**
1178      * Log a message at the <code>FATAL</code> level including the
1179      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
1180      *
1181      * @param message the message object to log.
1182      * @param t       the exception to log, including its stack trace.
1183      */
1184     public void fatal(String message, Throwable t) {
1185         if (isEnabled(Level.FATAL, null, message, t)) {
1186             log(null, FQCN, Level.FATAL, new SimpleMessage(message), t);
1187         }
1188     }
1189 
1190     /**
1191      * Log a message at the <code>FATAL</code> level including the
1192      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
1193      *
1194      * @param marker the marker data specific to this log statement.
1195      * @param message the message object to log.
1196      * @param t       the exception to log, including its stack trace.
1197      */
1198     public void fatal(Marker marker, String message, Throwable t) {
1199         if (isEnabled(Level.FATAL, marker, message, t)) {
1200             log(marker, FQCN, Level.FATAL, new SimpleMessage(message), t);
1201         }
1202     }
1203 
1204     /**
1205      * Log a message object with the {@link org.apache.logging.log4j.Level#FATAL FATAL} level.
1206      *
1207      * @param message the message object to log.
1208      */
1209     public void fatal(Object message) {
1210         if (isEnabled(Level.FATAL, null, message, null)) {
1211             log(null, FQCN, Level.FATAL, new ObjectMessage(message), null);
1212         }
1213     }
1214 
1215     /**
1216      * Log a message object with the {@link org.apache.logging.log4j.Level#FATAL FATAL} level.
1217      *
1218      * @param marker the marker data specific to this log statement.
1219      * @param message the message object to log.
1220      */
1221     public void fatal(Marker marker, Object message) {
1222         if (isEnabled(Level.FATAL, marker, message, null)) {
1223             log(marker, FQCN, Level.FATAL, new ObjectMessage(message), null);
1224         }
1225     }
1226 
1227     /**
1228      * Log a message at the <code>FATAL</code> level including the
1229      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
1230      *
1231      * @param message the message object to log.
1232      * @param t       the exception to log, including its stack trace.
1233      */
1234     public void fatal(Object message, Throwable t) {
1235         if (isEnabled(Level.FATAL, null, message, t)) {
1236             log(null, FQCN, Level.FATAL, new ObjectMessage(message), t);
1237         }
1238     }
1239 
1240     /**
1241      * Log a message at the <code>FATAL</code> level including the
1242      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
1243      *
1244      * @param marker the marker data specific to this log statement.
1245      * @param message the message object to log.
1246      * @param t       the exception to log, including its stack trace.
1247      */
1248     public void fatal(Marker marker, Object message, Throwable t) {
1249         if (isEnabled(Level.FATAL, marker, message, t)) {
1250             log(marker, FQCN, Level.FATAL, new ObjectMessage(message), t);
1251         }
1252     }
1253 
1254     /**
1255      * Log a message with parameters at the <code>FATAL</code> level.
1256      *
1257      * @param message the message to log.
1258      * @param params  parameters to the message.
1259      */
1260     public void fatal(String message, Object... params) {
1261         if (isEnabled(Level.FATAL, null, message, params)) {
1262             ParameterizedMessage msg = new ParameterizedMessage(message, params);
1263             log(null, FQCN, Level.FATAL, msg, msg.getThrowable());
1264         }
1265     }
1266 
1267     /**
1268      * Log a message with parameters at the <code>FATAL</code> level.
1269      *
1270      * @param marker the marker data specific to this log statement.
1271      * @param message the message to log.
1272      * @param params  parameters to the message.
1273      */
1274     public void fatal(Marker marker, String message, Object... params) {
1275         if (isEnabled(Level.FATAL, marker, message, params)) {
1276             ParameterizedMessage msg = new ParameterizedMessage(message, params);
1277             log(marker, FQCN, Level.FATAL, msg, msg.getThrowable());
1278         }
1279     }
1280 
1281     /**
1282      * Check whether this Logger is enabled for the FATAL Level.
1283      *
1284      * @return boolean - <code>true</code> if this Logger is enabled for level
1285      *         FATAL, <code>false</code> otherwise.
1286      */
1287     public boolean isFatalEnabled() {
1288         return isEnabled(Level.ERROR, null, (Object) null, null);
1289     }
1290 
1291     /**
1292      * Check whether this Logger is enabled for the FATAL Level.
1293      *
1294      * @param marker The marker data.
1295      * @return boolean - <code>true</code> if this Logger is enabled for level
1296      *         FATAL, <code>false</code> otherwise.
1297      */
1298     public boolean isFatalEnabled(Marker marker) {
1299         return isEnabled(Level.FATAL, marker, (Object) null, null);
1300     }
1301 
1302     /**
1303      * Log a message with the specific Marker at the FATAL level.
1304      *
1305      * @param msg the message string to be logged
1306      */
1307     public void fatal(Message msg) {
1308         if (isEnabled(Level.FATAL, null, msg, null)) {
1309             log(null, FQCN, Level.FATAL, msg, null);
1310         }
1311     }
1312 
1313     /**
1314      * Log a message with the specific Marker at the FATAL level.
1315      *
1316      * @param msg the message string to be logged
1317      * @param t   A Throwable or null.
1318      */
1319     public void fatal(Message msg, Throwable t) {
1320         if (isEnabled(Level.FATAL, null, msg, t)) {
1321             log(null, FQCN, Level.FATAL, msg, t);
1322         }
1323     }
1324 
1325     /**
1326      * Log a message with the specific Marker at the FATAL level.
1327      *
1328      * @param marker the marker data specific to this log statement
1329      * @param msg    the message string to be logged
1330      */
1331     public void fatal(Marker marker, Message msg) {
1332         if (isEnabled(Level.FATAL, null, msg, null)) {
1333             log(null, FQCN, Level.FATAL, msg, null);
1334         }
1335     }
1336 
1337     /**
1338      * Log a message with the specific Marker at the FATAL level.
1339      *
1340      * @param marker the marker data specific to this log statement
1341      * @param msg    the message string to be logged
1342      * @param t      A Throwable or null.
1343      */
1344     public void fatal(Marker marker, Message msg, Throwable t) {
1345         if (isEnabled(Level.FATAL, marker, msg, t)) {
1346             log(marker, FQCN, Level.FATAL, msg, t);
1347         }
1348     }
1349 
1350     /**
1351      * Log a message with location information.
1352      *
1353      * @param marker The Marker
1354      * @param fqcn   The fully qualified class name of the <b>caller</b>
1355      * @param level  The logging level
1356      * @param data   The Message.
1357      * @param t      A Throwable or null.
1358      */
1359     protected abstract void log(Marker marker, String fqcn, Level level, Message data, Throwable t);
1360 
1361     /*
1362      * Instead of one single method with Object... declared the following methods explicitly specify
1363      * parameters because they perform dramatically better than having the JVM convert them to an
1364      * array.
1365      */
1366 
1367     /**
1368      * Determine if logging is enabled.
1369      * @param level The logging Level to check.
1370      * @param marker A Marker or null.
1371      * @param data The message.
1372      * @return True if logging is enabled, false otherwise.
1373      */
1374     protected abstract boolean isEnabled(Level level, Marker marker, String data);
1375 
1376     /**
1377      * Determine if logging is enabled.
1378      * @param level The logging Level to check.
1379      * @param marker A Marker or null.
1380      * @param data The message.
1381      * @param t A Throwable.
1382      * @return True if logging is enabled, false otherwise.
1383      */
1384     protected abstract boolean isEnabled(Level level, Marker marker, String data, Throwable t);
1385 
1386     /**
1387      * Determine if logging is enabled.
1388      * @param level The logging Level to check.
1389      * @param marker A Marker or null.
1390      * @param data The message.
1391      * @param p1 The first parameter.
1392      * @return True if logging is enabled, false otherwise.
1393      */
1394     protected abstract boolean isEnabled(Level level, Marker marker, String data, Object p1);
1395 
1396     /**
1397      * Determine if logging is enabled.
1398      * @param level The logging Level to check.
1399      * @param marker A Marker or null.
1400      * @param data The message.
1401      * @param p1 The first parameter.
1402      * @param p2 The second parameter.
1403      * @return True if logging is enabled, false otherwise.
1404      */
1405     protected abstract boolean isEnabled(Level level, Marker marker, String data, Object p1, Object p2);
1406 
1407     /**
1408      * Determine if logging is enabled.
1409      * @param level The logging Level to check.
1410      * @param marker A Marker or null.
1411      * @param data The message.
1412      * @param p1 The first parameter.
1413      * @param p2 The second parameter.
1414      * @param p3 The third parameter.
1415      * @return True if logging is enabled, false otherwise.
1416      */
1417     protected abstract boolean isEnabled(Level level, Marker marker, String data, Object p1, Object p2, Object p3);
1418 
1419 
1420     /**
1421      * Determine if logging is enabled.
1422      * @param level The logging Level to check.
1423      * @param marker A Marker or null.
1424      * @param data The message.
1425      * @param p1 The first parameter.
1426      * @param p2 The second parameter.
1427      * @param p3 The third parameter.
1428      * @param params More message parameters.
1429      * @return True if logging is enabled, false otherwise.
1430      */
1431     protected abstract boolean isEnabled(Level level, Marker marker, String data, Object p1, Object p2,
1432                                          Object p3, Object... params);
1433 
1434     /**
1435      * Determine if logging is enabled.
1436      * @param level The logging Level to check.
1437      * @param marker A Marker or null.
1438      * @param data The message.
1439      * @param t A Throwable.
1440      * @return True if logging is enabled, false otherwise.
1441      */
1442     protected abstract boolean isEnabled(Level level, Marker marker, Object data, Throwable t);
1443 
1444     /**
1445      * Determine if logging is enabled.
1446      * @param level The logging Level to check.
1447      * @param marker A Marker or null.
1448      * @param data The Message.
1449      * @param t A Throwable.
1450      * @return True if logging is enabled, false otherwise.
1451      */
1452     protected abstract boolean isEnabled(Level level, Marker marker, Message data, Throwable t);
1453 
1454     private Message entryMsg(int count, Object... params) {
1455         if (count == 0) {
1456             return new SimpleMessage(" entry");
1457         }
1458         StringBuilder sb = new StringBuilder(" entry parms(");
1459         int i = 0;
1460         for (Object parm : params) {
1461             if (parm != null) {
1462                 sb.append(parm.toString());
1463             } else {
1464                 sb.append("null");
1465             }
1466             if (++i < params.length) {
1467                 sb.append(", ");
1468             }
1469         }
1470         sb.append(")");
1471         return new SimpleMessage(sb.toString());
1472     }
1473 
1474     private Message exitMsg(Object result) {
1475         if (result == null) {
1476             return new SimpleMessage(" exit");
1477         }
1478         return new SimpleMessage(" exit with (" + result + ")");
1479     }
1480 }