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  
18  package org.apache.log4j;
19  
20  
21  /**
22   * A proxy for org.slf4j.ULogger.  In slf4j implementing builds, this
23   * interface will extend org.slf4j.ULogger and add no additional methods.
24   *
25   * @author Ceki Gülcü
26   * @author Curt Arnold
27   */
28  public interface ULogger {
29  
30  
31      /**
32       * Is the logger instance enabled for the DEBUG level?
33       *
34       * @return true if debug is enabled.
35       */
36      boolean isDebugEnabled();
37  
38      /**
39       * Log a message object with the DEBUG level.
40       *
41       * @param msg - the message object to be logged
42       */
43      void debug(Object msg);
44  
45  
46      /**
47       * Log a parameterized message object at the DEBUG level.
48       * <p>
49       * <p>This form is useful in avoiding the superflous object creation
50       * problem when invoking this method while it is disabled.
51       * </p>
52       *
53       * @param parameterizedMsg - the parameterized message object
54       * @param param1           - the parameter
55       */
56      void debug(Object parameterizedMsg, Object param1);
57  
58      /**
59       * Log a parameterized message object at the DEBUG level.
60       * <p>
61       * <p>This form is useful in avoiding the superflous object creation
62       * problem when invoking this method while it is disabled.
63       * </p>
64       *
65       * @param parameterizedMsg - the parameterized message object
66       * @param param1           - the first parameter
67       * @param param2           - the second parameter
68       */
69      void debug(String parameterizedMsg, Object param1, Object param2);
70  
71      /**
72       * Log a message object with the <code>DEBUG</code> level including the
73       * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
74       *
75       * @param msg the message object to log.
76       * @param t   the exception to log, including its stack trace.
77       */
78      void debug(Object msg, Throwable t);
79  
80  
81      /**
82       * Is the logger instance enabled for the INFO level?
83       *
84       * @return true if debug is enabled.
85       */
86      boolean isInfoEnabled();
87  
88      /**
89       * Log a message object with the INFO level.
90       *
91       * @param msg - the message object to be logged
92       */
93      void info(Object msg);
94  
95      /**
96       * Log a parameterized message object at the INFO level.
97       * <p>
98       * <p>This form is useful in avoiding the superflous object creation
99       * problem when invoking this method while it is disabled.
100      * </p>
101      *
102      * @param parameterizedMsg - the parameterized message object
103      * @param param1           - the parameter
104      */
105     void info(Object parameterizedMsg, Object param1);
106 
107     /**
108      * Log a parameterized message object at the INFO level.
109      * <p>
110      * <p>This form is useful in avoiding the superflous object creation
111      * problem when invoking this method while it is disabled.
112      * </p>
113      *
114      * @param parameterizedMsg - the parameterized message object
115      * @param param1           - the first parameter
116      * @param param2           - the second parameter
117      */
118     void info(String parameterizedMsg, Object param1, Object param2);
119 
120     /**
121      * Log a message object with the <code>INFO</code> level including the
122      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
123      *
124      * @param msg the message object to log.
125      * @param t   the exception to log, including its stack trace.
126      */
127     void info(Object msg, Throwable t);
128 
129 
130     /**
131      * Is the logger instance enabled for the WARN level?
132      *
133      * @return true if debug is enabled.
134      */
135     boolean isWarnEnabled();
136 
137     /**
138      * Log a message object with the WARN level.
139      *
140      * @param msg - the message object to be logged
141      */
142     void warn(Object msg);
143 
144     /**
145      * Log a parameterized message object at the WARN level.
146      * <p>
147      * <p>This form is useful in avoiding the superflous object creation
148      * problem when invoking this method while it is disabled.
149      * </p>
150      *
151      * @param parameterizedMsg - the parameterized message object
152      * @param param1           - the parameter
153      */
154     void warn(Object parameterizedMsg, Object param1);
155 
156     /**
157      * Log a parameterized message object at the WARN level.
158      * <p>
159      * <p>This form is useful in avoiding the superflous object creation
160      * problem when invoking this method while it is disabled.
161      * </p>
162      *
163      * @param parameterizedMsg - the parameterized message object
164      * @param param1           - the first parameter
165      * @param param2           - the second parameter
166      */
167     void warn(String parameterizedMsg, Object param1, Object param2);
168 
169     /**
170      * Log a message object with the <code>WARN</code> level including the
171      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
172      *
173      * @param msg the message object to log.
174      * @param t   the exception to log, including its stack trace.
175      */
176     void warn(Object msg, Throwable t);
177 
178 
179     /**
180      * Is the logger instance enabled for the ERROR level?
181      *
182      * @return true if debug is enabled.
183      */
184     boolean isErrorEnabled();
185 
186     /**
187      * Log a message object with the ERROR level.
188      *
189      * @param msg - the message object to be logged
190      */
191     void error(Object msg);
192 
193     /**
194      * Log a parameterized message object at the ERROR level.
195      * <p>
196      * <p>This form is useful in avoiding the superflous object creation
197      * problem when invoking this method while it is disabled.
198      * </p>
199      *
200      * @param parameterizedMsg - the parameterized message object
201      * @param param1           - the parameter
202      */
203     void error(Object parameterizedMsg, Object param1);
204 
205     /**
206      * Log a parameterized message object at the ERROR level.
207      * <p>
208      * <p>This form is useful in avoiding the superflous object creation
209      * problem when invoking this method while it is disabled.
210      * </p>
211      *
212      * @param parameterizedMsg - the parameterized message object
213      * @param param1           - the first parameter
214      * @param param2           - the second parameter
215      */
216     void error(String parameterizedMsg, Object param1, Object param2);
217 
218     /**
219      * Log a message object with the <code>ERROR</code> level including the
220      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
221      *
222      * @param msg the message object to log.
223      * @param t   the exception to log, including its stack trace.
224      */
225     void error(Object msg, Throwable t);
226 
227 }