1 /*
2 * This file is part of AceLogger.
3 *
4 * AceLogger is free software: you can redistribute it and/or modify it under the terms of the GNU
5 * Lesser General Public License as published by the Free Software Foundation, either version 3 of
6 * the License, or (at your option) any later version.
7 *
8 * AceLogger is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
9 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
11 *
12 * You should have received a copy of the GNU Lesser General Public License along with AceLogger.
13 * If not, see <http://www.gnu.org/licenses/lgpl-3.0.html>.
14 */
15 package net.sourceforge.acelogger;
16
17 /**
18 * A logging interface that provides the methods needed to manage log calls, abstracting the
19 * configuration to the framework.
20 *
21 * @author Zardi (https://sourceforge.net/users/daniel_zardi)
22 * @version 1.0.0
23 * @since 1.0.0
24 */
25 public interface Logger extends Identifiable {
26
27 /**
28 * Checks the suitability of the tracing level for this Logger.
29 *
30 * @return True if the tracing level is suitable for this logger, false otherwise.
31 * @since 1.0.0
32 */
33 public boolean isTraceEnabled();
34
35 /**
36 * Checks the suitability of the debug level for this Logger.
37 *
38 * @return True if the debug level is suitable for this logger, false otherwise.
39 * @since 1.0.0
40 */
41 public boolean isDebugEnabled();
42
43 /**
44 * Checks the suitability of the information level for this Logger.
45 *
46 * @return True if the information level is suitable for this logger, false otherwise.
47 * @since 1.0.0
48 */
49 public boolean isInfoEnabled();
50
51 /**
52 * Checks the suitability of the warning level for this Logger.
53 *
54 * @return True if the warning level is suitable for this logger, false otherwise.
55 * @since 1.0.0
56 */
57 public boolean isWarnEnabled();
58
59 /**
60 * Checks the suitability of the error level for this Logger.
61 *
62 * @return True if the error level is suitable for this logger, false otherwise.
63 * @since 1.0.0
64 */
65 public boolean isErrorEnabled();
66
67 /**
68 * Checks the suitability of the fatal level for this Logger.
69 *
70 * @return True if the fatal level is suitable for this logger, false otherwise.
71 * @since 1.0.0
72 */
73 public boolean isFatalEnabled();
74
75 /**
76 * Creates a tracing level log message, the final message will depend on the underlying
77 * Formatter.
78 *
79 * @param message
80 * The message to be formatted and then logged.
81 * @param params
82 * The list of parameter used to format the message.
83 * @since 1.0.0
84 */
85 public void trace(String message, Object... params);
86
87 /**
88 * Creates a tracing level log message, the final message will depend on the underlying
89 * Formatter.
90 *
91 * @param message
92 * The message to be formatted and then logged.
93 * @param cause
94 * The Throwable that originated this log call.
95 * @param params
96 * The list of parameter used to format the message.
97 * @since 1.0.0
98 */
99 public void trace(String message, Throwable cause, Object... params);
100
101 /**
102 * Creates a debug level log message, the final message will depend on the underlying Formatter
103 * and parameters.
104 *
105 * @param message
106 * The message to be formatted and then logged.
107 * @param params
108 * The list of parameter used to format the message.
109 * @since 1.0.0
110 */
111 public void debug(String message, Object... params);
112
113 /**
114 * Creates a debug level log message, the final message will depend on the underlying Formatter
115 * and parameters.
116 *
117 * @param message
118 * The message to be formatted and then logged.
119 * @param cause
120 * The Throwable that originated this log call.
121 * @param params
122 * The list of parameter used to format the message.
123 * @since 1.0.0
124 */
125 public void debug(String message, Throwable cause, Object... params);
126
127 /**
128 * Creates a information level log message, the final message will depend on the underlying
129 * Formatter.
130 *
131 * @param message
132 * The message to be formatted and then logged.
133 * @param params
134 * The list of parameter used to format the message.
135 * @since 1.0.0
136 */
137 public void info(String message, Object... params);
138
139 /**
140 * Creates a information level log message, the final message will depend on the underlying
141 * Formatter.
142 *
143 * @param message
144 * The message to be formatted and then logged.
145 * @param cause
146 * The Throwable that originated this log call.
147 * @param params
148 * The list of parameter used to format the message.
149 * @since 1.0.0
150 */
151 public void info(String message, Throwable cause, Object... params);
152
153 /**
154 * Creates a warning level log message, the final message will depend on the underlying
155 * Formatter.
156 *
157 * @param message
158 * The message to be formatted and then logged.
159 * @param params
160 * The list of parameter used to format the message.
161 * @since 1.0.0
162 */
163 public void warn(String message, Object... params);
164
165 /**
166 * Creates a warning level log message, the final message will depend on the underlying
167 * Formatter.
168 *
169 * @param message
170 * The message to be formatted and then logged.
171 * @param cause
172 * The Throwable that originated this log call.
173 * @param params
174 * The list of parameter used to format the message.
175 * @since 1.0.0
176 */
177 public void warn(String message, Throwable cause, Object... params);
178
179 /**
180 * Creates a error level log message, the final message will depend on the underlying Formatter
181 * and parameters.
182 *
183 * @param message
184 * The message to be formatted and then logged.
185 * @param params
186 * The list of parameter used to format the message.
187 * @since 1.0.0
188 */
189 public void error(String message, Object... params);
190
191 /**
192 * Creates a error level log message, the final message will depend on the underlying Formatter
193 * and parameters.
194 *
195 * @param message
196 * The message to be formatted and then logged.
197 * @param cause
198 * The Throwable that originated this log call.
199 * @param params
200 * The list of parameter used to format the message.
201 * @since 1.0.0
202 */
203 public void error(String message, Throwable cause, Object... params);
204
205 /**
206 * Creates a fatal level log message, the final message will depend on the underlying Formatter
207 * and parameters.
208 *
209 * @param message
210 * The message to be formatted and then logged.
211 * @param params
212 * The list of parameter used to format the message.
213 * @since 1.0.0
214 */
215 public void fatal(String message, Object... params);
216
217 /**
218 * Creates a fatal level log message, the final message will depend on the underlying Formatter
219 * and parameters.
220 *
221 * @param message
222 * The message to be formatted and then logged.
223 * @param cause
224 * The Throwable that originated this log call.
225 * @param params
226 * The list of parameter used to format the message.
227 * @since 1.0.0
228 */
229 public void fatal(String message, Throwable cause, Object... params);
230
231 }