View Javadoc

1   // SECTION-START[License Header]
2   // <editor-fold defaultstate="collapsed" desc=" Generated License ">
3   /*
4    *   Java Object Management and Configuration
5    *   Copyright (C) Christian Schulte, 2005-206
6    *   All rights reserved.
7    *
8    *   Redistribution and use in source and binary forms, with or without
9    *   modification, are permitted provided that the following conditions
10   *   are met:
11   *
12   *     o Redistributions of source code must retain the above copyright
13   *       notice, this list of conditions and the following disclaimer.
14   *
15   *     o Redistributions in binary form must reproduce the above copyright
16   *       notice, this list of conditions and the following disclaimer in
17   *       the documentation and/or other materials provided with the
18   *       distribution.
19   *
20   *   THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21   *   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22   *   AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
23   *   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
24   *   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25   *   NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26   *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27   *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28   *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29   *   THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30   *
31   *   $JOMC: Logger.java 4716 2013-01-03 05:38:09Z schulte $
32   *
33   */
34  // </editor-fold>
35  // SECTION-END
36  package org.jomc.logging;
37  
38  // SECTION-START[Documentation]
39  // <editor-fold defaultstate="collapsed" desc=" Generated Documentation ">
40  /**
41   * Logs events for a specific component.
42   *
43   * <dl>
44   *   <dt><b>Identifier:</b></dt><dd>org.jomc.logging.Logger</dd>
45   *   <dt><b>Multiplicity:</b></dt><dd>One</dd>
46   *   <dt><b>Scope:</b></dt><dd>None</dd>
47   * </dl>
48   *
49   * @author <a href="mailto:cs@schulte.it">Christian Schulte</a> 1.0
50   * @version 1.0
51   * @see org.jomc.ObjectManager#getObject(java.lang.Class) getObject(Logger.class)
52   * @see org.jomc.ObjectManager#getObject(java.lang.Class,java.lang.String) getObject(Logger.class, "<i>implementation name</i>")
53   * @see org.jomc.ObjectManagerFactory
54   */
55  // </editor-fold>
56  // SECTION-END
57  // SECTION-START[Annotations]
58  // <editor-fold defaultstate="collapsed" desc=" Generated Annotations ">
59  @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.4", comments = "See http://www.jomc.org/jomc/1.4/jomc-tools-1.4" )
60  // </editor-fold>
61  // SECTION-END
62  public interface Logger
63  {
64      // SECTION-START[Logger]
65  
66      /**
67       * Gets a flag indicating logging debug messages is enabled.
68       *
69       * @return {@code true}, if logging debug messages is enabled; {@code false}, if logging debug messages is disabled.
70       */
71      boolean isDebugEnabled();
72  
73      /**
74       * Logs a debug message.
75       *
76       * @param message The message to log.
77       */
78      void debug( String message );
79  
80      /**
81       * Logs a debug exception.
82       *
83       * @param t The exception to log.
84       */
85      void debug( Throwable t );
86  
87      /**
88       * Logs a debug message and exception.
89       *
90       * @param message The message to log.
91       * @param t The exception to log.
92       */
93      void debug( String message, Throwable t );
94  
95      /**
96       * Gets a flag indicating logging error messages is enabled.
97       *
98       * @return {@code true}, if logging error messages is enabled; {@code false}, if logging error messages is disabled.
99       */
100     boolean isErrorEnabled();
101 
102     /**
103      * Logs an error message.
104      *
105      * @param message The message to log.
106      */
107     void error( String message );
108 
109     /**
110      * Logs an error exception.
111      *
112      * @param t The exception to log.
113      */
114     void error( Throwable t );
115 
116     /**
117      * Logs an error message and exception.
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      * Gets a flag indicating logging fatal messages is enabled.
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 fatal message.
133      *
134      * @param message The message to log.
135      */
136     void fatal( String message );
137 
138     /**
139      * Logs a fatal exception.
140      *
141      * @param t The exception to log.
142      */
143     void fatal( Throwable t );
144 
145     /**
146      * Logs a fatal message and exception.
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      * Gets a flag indicating logging info messages is enabled.
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 an info message.
162      *
163      * @param message The message to log.
164      */
165     void info( String message );
166 
167     /**
168      * Logs an info exception.
169      *
170      * @param t The exception to log.
171      */
172     void info( Throwable t );
173 
174     /**
175      * Logs an info message and exception.
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      * Gets a flag indicating logging trace messages is enabled.
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 trace message.
191      *
192      * @param message The message to log.
193      */
194     void trace( String message );
195 
196     /**
197      * Logs a trace exception.
198      *
199      * @param t The exception to log.
200      */
201     void trace( Throwable t );
202 
203     /**
204      * Logs a trace message and exception.
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      * Gets a flag indicating logging warning messages is enabled.
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 warning message.
221      *
222      * @param message The message to log.
223      */
224     void warn( String message );
225 
226     /**
227      * Logs a warning exception.
228      *
229      * @param t The exception to log.
230      */
231     void warn( Throwable t );
232 
233     /**
234      * Logs a warning message and exception.
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     // SECTION-END
242 }