001 // SECTION-START[License Header]
002 // <editor-fold defaultstate="collapsed" desc=" Generated License ">
003 /*
004 * Copyright (c) 2009 The JOMC Project
005 * Copyright (c) 2005 Christian Schulte <cs@jomc.org>
006 * All rights reserved.
007 *
008 * Redistribution and use in source and binary forms, with or without
009 * modification, are permitted provided that the following conditions
010 * are met:
011 *
012 * o Redistributions of source code must retain the above copyright
013 * notice, this list of conditions and the following disclaimer.
014 *
015 * o Redistributions in binary form must reproduce the above copyright
016 * notice, this list of conditions and the following disclaimer in
017 * the documentation and/or other materials provided with the
018 * distribution.
019 *
020 * THIS SOFTWARE IS PROVIDED BY THE JOMC PROJECT AND CONTRIBUTORS "AS IS"
021 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
022 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
023 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JOMC PROJECT OR
024 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
025 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
026 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
027 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
028 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
029 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
030 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
031 *
032 * $Id$
033 *
034 */
035 // </editor-fold>
036 // SECTION-END
037 package org.jomc.logging;
038
039 // SECTION-START[Documentation]
040 // <editor-fold defaultstate="collapsed" desc=" Generated Documentation ">
041 /**
042 * Logs events for a specific component.
043 * <p>This specification declares a multiplicity of {@code One}.
044 * An application assembler is required to provide no more than one implementation of this specification (including none).
045 * Use of class {@link org.jomc.ObjectManager ObjectManager} is supported for getting that implementation.<pre>
046 * Logger object = (Logger) ObjectManagerFactory.getObjectManager( getClassLoader() ).getObject( Logger.class );
047 * </pre>
048 * </p>
049 *
050 * <p>This specification does not apply to any scope. A new object is returned whenever requested.</p>
051 *
052 * @author <a href="mailto:cs@jomc.org">Christian Schulte</a> 1.0
053 * @version $Id$
054 */
055 // </editor-fold>
056 // SECTION-END
057 // SECTION-START[Annotations]
058 // <editor-fold defaultstate="collapsed" desc=" Generated Annotations ">
059 @javax.annotation.Generated( value = "org.jomc.tools.JavaSources",
060 comments = "See http://jomc.sourceforge.net/jomc/1.0-alpha-8/jomc-tools" )
061 // </editor-fold>
062 // SECTION-END
063 public interface Logger
064 {
065
066 /**
067 * Getter for property {@code debugEnabled}.
068 *
069 * @return {@code true} if logging debug messages is enabled; {@code false} if logging debug messages is disabled.
070 */
071 boolean isDebugEnabled();
072
073 /**
074 * Logs a message at log level {@code debug}.
075 *
076 * @param message The message to log.
077 */
078 void debug( String message );
079
080 /**
081 * Logs an exception at log level {@code debug}.
082 *
083 * @param t The exception to log.
084 */
085 void debug( Throwable t );
086
087 /**
088 * Logs a message and an exception at log level {@code debug}.
089 *
090 * @param message The message to log.
091 * @param t The exception to log.
092 */
093 void debug( String message, Throwable t );
094
095 /**
096 * Getter for property {@code errorEnabled}.
097 *
098 * @return {@code true} if logging error messages is enabled; {@code false} if logging error messages is disabled.
099 */
100 boolean isErrorEnabled();
101
102 /**
103 * Logs a message at log level {@code error}.
104 *
105 * @param message The message to log.
106 */
107 void error( String message );
108
109 /**
110 * Logs an exception at log level {@code error}.
111 *
112 * @param t The exception to log.
113 */
114 void error( Throwable t );
115
116 /**
117 * Logs a message and an exception at log level {@code error}.
118 *
119 * @param message The message to log.
120 * @param t The exception to log.
121 */
122 void error( String message, Throwable t );
123
124 /**
125 * Getter for property {@code fatalEnabled}.
126 *
127 * @return {@code true} if logging fatal messages is enabled; {@code false} if logging fatal messages is disabled.
128 */
129 boolean isFatalEnabled();
130
131 /**
132 * Logs a message at log level {@code fatal}.
133 *
134 * @param message The message to log.
135 */
136 void fatal( String message );
137
138 /**
139 * Logs an exception at log level {@code fatal}.
140 *
141 * @param t The exception to log.
142 */
143 void fatal( Throwable t );
144
145 /**
146 * Logs a message and an exception at log level {@code fatal}.
147 *
148 * @param message The message to log.
149 * @param t The exception to log.
150 */
151 void fatal( String message, Throwable t );
152
153 /**
154 * Getter for property {@code infoEnabled}.
155 *
156 * @return {@code true} if logging info messages is enabled; {@code false} if logging info messages is disabled.
157 */
158 boolean isInfoEnabled();
159
160 /**
161 * Logs a message at log level {@code info}.
162 *
163 * @param message The message to log.
164 */
165 void info( String message );
166
167 /**
168 * Logs an exception at log level {@code info}.
169 *
170 * @param t The exception to log.
171 */
172 void info( Throwable t );
173
174 /**
175 * Logs a message and an exception at log level {@code info}.
176 *
177 * @param message The message to log.
178 * @param t The exception to log.
179 */
180 void info( String message, Throwable t );
181
182 /**
183 * Getter for property {@code traceEnabled}.
184 *
185 * @return {@code true} if logging trace messages is enabled; {@code false} if logging trace messages is disabled.
186 */
187 boolean isTraceEnabled();
188
189 /**
190 * Logs a message at log level {@code trace}.
191 *
192 * @param message The message to log.
193 */
194 void trace( String message );
195
196 /**
197 * Logs an exception at log level {@code trace}.
198 *
199 * @param t The exception to log.
200 */
201 void trace( Throwable t );
202
203 /**
204 * Logs a message and an exception at log level {@code trace}.
205 *
206 * @param message The message to log.
207 * @param t The exception to log.
208 */
209 void trace( String message, Throwable t );
210
211 /**
212 * Getter for property {@code warnEnabled}.
213 *
214 * @return {@code true} if logging warning messages is enabled; {@code false} if logging warning messages is
215 * disabled.
216 */
217 boolean isWarnEnabled();
218
219 /**
220 * Logs a message at log level {@code warn}.
221 *
222 * @param message The message to log.
223 */
224 void warn( String message );
225
226 /**
227 * Logs an exception at log level {@code warn}.
228 *
229 * @param t The exception to log.
230 */
231 void warn( Throwable t );
232
233 /**
234 * Logs a message and an exception at log level {@code warn}.
235 *
236 * @param message The message to log.
237 * @param t The exception to log.
238 */
239 void warn( String message, Throwable t );
240
241 }