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     * @return true if debug is enabled.
34     */
35    boolean isDebugEnabled();
36  
37    /**
38     * Log a message object with the DEBUG level.
39     * @param msg - the message object to be logged
40     */
41    void debug(Object msg);
42  
43  
44    /**
45     * Log a parameterized message object at the DEBUG level.
46     *
47     * <p>This form is useful in avoiding the superflous object creation
48     * problem when invoking this method while it is disabled.
49     * </p>
50     * @param parameterizedMsg - the parameterized message object
51     * @param param1 - the parameter
52     */
53    void debug(Object parameterizedMsg, Object param1);
54  
55    /**
56     * Log a parameterized message object at the DEBUG level.
57     *
58     * <p>This form is useful in avoiding the superflous object creation
59     * problem when invoking this method while it is disabled.
60     * </p>
61     * @param parameterizedMsg - the parameterized message object
62     * @param param1 - the first parameter
63     * @param param2 - the second parameter
64     */
65    void debug(String parameterizedMsg, Object param1, Object param2);
66      /**
67       * Log a message object with the <code>DEBUG</code> level including the
68       * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
69       *
70       *
71       * @param msg the message object to log.
72       * @param t the exception to log, including its stack trace.
73       */
74    void debug(Object msg, Throwable t);
75  
76  
77      /**
78       * Is the logger instance enabled for the INFO level?
79       * @return true if debug is enabled.
80       */
81    boolean isInfoEnabled();
82      /**
83       * Log a message object with the INFO level.
84       * @param msg - the message object to be logged
85       */
86    void info(Object msg);
87      /**
88       * Log a parameterized message object at the INFO level.
89       *
90       * <p>This form is useful in avoiding the superflous object creation
91       * problem when invoking this method while it is disabled.
92       * </p>
93       * @param parameterizedMsg - the parameterized message object
94       * @param param1 - the parameter
95       */
96    void info(Object parameterizedMsg, Object param1);
97      /**
98       * Log a parameterized message object at the INFO level.
99       *
100      * <p>This form is useful in avoiding the superflous object creation
101      * problem when invoking this method while it is disabled.
102      * </p>
103      * @param parameterizedMsg - the parameterized message object
104      * @param param1 - the first parameter
105      * @param param2 - the second parameter
106      */
107   void info(String parameterizedMsg, Object param1, Object param2);
108     /**
109      * Log a message object with the <code>INFO</code> level including the
110      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
111      *
112      *
113      * @param msg the message object to log.
114      * @param t the exception to log, including its stack trace.
115      */
116   void info(Object msg, Throwable t);
117 
118 
119     /**
120      * Is the logger instance enabled for the WARN level?
121      * @return true if debug is enabled.
122      */
123   boolean isWarnEnabled();
124     /**
125      * Log a message object with the WARN level.
126      * @param msg - the message object to be logged
127      */
128   void warn(Object msg);
129     /**
130      * Log a parameterized message object at the WARN level.
131      *
132      * <p>This form is useful in avoiding the superflous object creation
133      * problem when invoking this method while it is disabled.
134      * </p>
135      * @param parameterizedMsg - the parameterized message object
136      * @param param1 - the parameter
137      */
138   void warn(Object parameterizedMsg, Object param1);
139     /**
140      * Log a parameterized message object at the WARN level.
141      *
142      * <p>This form is useful in avoiding the superflous object creation
143      * problem when invoking this method while it is disabled.
144      * </p>
145      * @param parameterizedMsg - the parameterized message object
146      * @param param1 - the first parameter
147      * @param param2 - the second parameter
148      */
149   void warn(String parameterizedMsg, Object param1, Object param2);
150     /**
151      * Log a message object with the <code>WARN</code> level including the
152      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
153      *
154      *
155      * @param msg the message object to log.
156      * @param t the exception to log, including its stack trace.
157      */
158   void warn(Object msg, Throwable t);
159 
160 
161     /**
162      * Is the logger instance enabled for the ERROR level?
163      * @return true if debug is enabled.
164      */
165   boolean isErrorEnabled();
166     /**
167      * Log a message object with the ERROR level.
168      * @param msg - the message object to be logged
169      */
170   void error(Object msg);
171     /**
172      * Log a parameterized message object at the ERROR level.
173      *
174      * <p>This form is useful in avoiding the superflous object creation
175      * problem when invoking this method while it is disabled.
176      * </p>
177      * @param parameterizedMsg - the parameterized message object
178      * @param param1 - the parameter
179      */
180   void error(Object parameterizedMsg, Object param1);
181     /**
182      * Log a parameterized message object at the ERROR level.
183      *
184      * <p>This form is useful in avoiding the superflous object creation
185      * problem when invoking this method while it is disabled.
186      * </p>
187      * @param parameterizedMsg - the parameterized message object
188      * @param param1 - the first parameter
189      * @param param2 - the second parameter
190      */
191   void error(String parameterizedMsg, Object param1, Object param2);
192 
193     /**
194      * Log a message object with the <code>ERROR</code> level including the
195      * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
196      *
197      *
198      * @param msg the message object to log.
199      * @param t the exception to log, including its stack trace.
200      */
201     void error(Object msg, Throwable t);
202 
203 }