View Javadoc

1   /*
2    *  jDTAUS Core SPI
3    *  Copyright (C) 2005 Christian Schulte
4    *  <cs@schulte.it>
5    *
6    *  This library is free software; you can redistribute it and/or
7    *  modify it under the terms of the GNU Lesser General Public
8    *  License as published by the Free Software Foundation; either
9    *  version 2.1 of the License, or any later version.
10   *
11   *  This library is distributed in the hope that it will be useful,
12   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14   *  Lesser General Public License for more details.
15   *
16   *  You should have received a copy of the GNU Lesser General Public
17   *  License along with this library; if not, write to the Free Software
18   *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19   *
20   */
21  package org.jdtaus.core.logging.spi;
22  
23  /**
24   * Logs events for a specific component.
25   * <p>jDTAUS Core SPI {@code Logger} specification to be used by implementations
26   * to log technical events.</p>
27   *
28   * @author <a href="mailto:cs@schulte.it">Christian Schulte</a>
29   * @version $JDTAUS: Logger.java 8641 2012-09-27 06:45:17Z schulte $
30   * @see org.jdtaus.core.container.Container
31   */
32  public interface Logger
33  {
34      //--Logger------------------------------------------------------------------
35  
36      /**
37       * Getter for property {@code debugEnabled}.
38       *
39       * @return {@code true} if logging debug messages is enabled; {@code false}
40       * if logging debug messages is disabled.
41       */
42      boolean isDebugEnabled();
43  
44      /**
45       * Logs a message at log level {@code debug}.
46       *
47       * @param message the message to log.
48       */
49      void debug( String message );
50  
51      /**
52       * Logs an exception at log level {@code debug}.
53       *
54       * @param t the exception to log.
55       */
56      void debug( Throwable t );
57  
58      /**
59       * Getter for property {@code errorEnabled}.
60       *
61       * @return {@code true} if logging error messages is enabled; {@code false}
62       * if logging error messages is disabled.
63       */
64      boolean isErrorEnabled();
65  
66      /**
67       * Logs a message at log level {@code error}.
68       *
69       * @param message the message to log.
70       */
71      void error( String message );
72  
73      /**
74       * Logs an exception at log level {@code error}.
75       *
76       * @param t the exception to log.
77       */
78      void error( Throwable t );
79  
80      /**
81       * Getter for property {@code fatalEnabled}.
82       *
83       * @return {@code true} if logging fatal messages is enabled; {@code false}
84       * if logging fatal messages is disabled.
85       */
86      boolean isFatalEnabled();
87  
88      /**
89       * Logs a message at log level {@code fatal}.
90       *
91       * @param message the message to log.
92       */
93      void fatal( String message );
94  
95      /**
96       * Logs an exception at log level {@code fatal}.
97       *
98       * @param t the exception to log.
99       */
100     void fatal( Throwable t );
101 
102     /**
103      * Getter for property {@code infoEnabled}.
104      *
105      * @return {@code true} if logging info messages is enabled; {@code false}
106      * if logging info messages is disabled.
107      */
108     boolean isInfoEnabled();
109 
110     /**
111      * Logs a message at log level {@code info}.
112      *
113      * @param message the message to log.
114      */
115     void info( String message );
116 
117     /**
118      * Logs an exception at log level {@code info}.
119      *
120      * @param t the exception to log.
121      */
122     void info( Throwable t );
123 
124     /**
125      * Getter for property {@code traceEnabled}.
126      *
127      * @return {@code true} if logging trace messages is enabled; {@code false}
128      * if logging trace messages is disabled.
129      */
130     boolean isTraceEnabled();
131 
132     /**
133      * Logs a message at log level {@code trace}.
134      *
135      * @param message the message to log.
136      */
137     void trace( String message );
138 
139     /**
140      * Logs an exception at log level {@code trace}.
141      *
142      * @param t the exception to log.
143      */
144     void trace( Throwable t );
145 
146     /**
147      * Getter for property {@code warnEnabled}.
148      *
149      * @return {@code true} if logging warning messages is enabled;
150      * {@code false} if logging warning messages is disabled.
151      */
152     boolean isWarnEnabled();
153 
154     /**
155      * Logs a message at log level {@code warn}.
156      *
157      * @param message the message to log.
158      */
159     void warn( String message );
160 
161     /**
162      * Logs an exception at log level {@code warn}.
163      *
164      * @param t the exception to log.
165      */
166     void warn( Throwable t );
167 
168     //------------------------------------------------------------------Logger--
169 }