KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snmp4j > log > LogAdapter


1 /*_############################################################################
2   _##
3   _## SNMP4J - LogAdapter.java
4   _##
5   _## Copyright 2003-2007 Frank Fock and Jochen Katz (SNMP4J.org)
6   _##
7   _## Licensed under the Apache License, Version 2.0 (the "License");
8   _## you may not use this file except in compliance with the License.
9   _## You may obtain a copy of the License at
10   _##
11   _## http://www.apache.org/licenses/LICENSE-2.0
12   _##
13   _## Unless required by applicable law or agreed to in writing, software
14   _## distributed under the License is distributed on an "AS IS" BASIS,
15   _## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   _## See the License for the specific language governing permissions and
17   _## limitations under the License.
18   _##
19   _##########################################################################*/

20
21
22
23 package org.snmp4j.log;
24
25 import java.util.Iterator JavaDoc;
26
27 /**
28  * The <code>LogAdapter</code> specifies the logging interface used by
29  * SNMP4J. To provide another logging mechanism as the default no-logging
30  * the static method {@link LogFactory#setLogFactory} can be used to assign
31  * a different logging adapter factory.
32  *
33  * @author Frank Fock
34  * @version 1.6.1
35  * @since 1.2.1
36  */

37 public interface LogAdapter {
38
39   /**
40    * Checks whether DEBUG level logging is activated for this log adapter.
41    * @return
42    * <code>true</code> if logging is enabled or <code>false</code> otherwise.
43    */

44   boolean isDebugEnabled();
45
46   /**
47    * Checks whether INFO level logging is activated for this log adapter.
48    * @return
49    * <code>true</code> if logging is enabled or <code>false</code> otherwise.
50    */

51   boolean isInfoEnabled();
52
53   /**
54    * Checks whether WARN level logging is activated for this log adapter.
55    * @return
56    * <code>true</code> if logging is enabled or <code>false</code> otherwise.
57    */

58   boolean isWarnEnabled();
59
60   /**
61    * Logs a debug message.
62    * @param message
63    * the message to log.
64    */

65   void debug(Object JavaDoc message);
66
67   /**
68    * Logs an informational message.
69    * @param message
70    * the message to log.
71    */

72   void info(Object JavaDoc message);
73
74   /**
75    * Logs an warning message.
76    * @param message
77    * the message to log.
78    */

79   void warn(Object JavaDoc message);
80
81   /**
82    * Logs an error message.
83    * @param message
84    * the message to log.
85    */

86   void error(Object JavaDoc message);
87
88   /**
89    * Logs an error message.
90    * @param message
91    * the message to log.
92    * @param throwable
93    * the exception that caused to error.
94    */

95   void error(Object JavaDoc message, Throwable JavaDoc throwable);
96
97   /**
98    * Logs a fatal message.
99    * @param message
100    * the message to log.
101    */

102   void fatal(Object JavaDoc message);
103
104   /**
105    * Logs a fatal message.
106    * @param message
107    * the message to log.
108    * @param throwable
109    * the exception that caused to error.
110    */

111   void fatal(Object JavaDoc message, Throwable JavaDoc throwable);
112
113   /**
114    * Sets the log level for this log adapter (if applicable).
115    * @param level
116    * a LogLevel instance.
117    * @since 1.6.1
118    */

119   void setLogLevel(LogLevel level);
120
121   /**
122    * Returns the log level defined for this log adapter.
123    * @return
124    * a LogLevel instance.
125    * @since 1.6.1
126    */

127   LogLevel getLogLevel();
128
129   /**
130    * Returns the log level that is effective for this log adapter.
131    * The effective log level is the first log level different from
132    * {@link LogLevel#NONE} to the root.
133    * @return
134    * a LogLevel different than {@link LogLevel#NONE}.
135    * @since 1.6.1
136    */

137   LogLevel getEffectiveLogLevel();
138
139   /**
140    * Returns the name of the logger.
141    * @return
142    * the name of the logger.
143    */

144   String JavaDoc getName();
145
146   /**
147    * Returns the log handlers associated with this logger.
148    * @return
149    * an Iterator of log system dependent log handlers.
150    * @since 1.6.1
151    */

152   Iterator JavaDoc getLogHandler();
153 }
154
Popular Tags