KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*_############################################################################
2   _##
3   _## SNMP4J - NoLogger.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 package org.snmp4j.log;
22
23 import java.util.Iterator JavaDoc;
24 import java.util.Collections JavaDoc;
25
26 /**
27  * The <code>NoLogger</code> implements a <code>LogAdapter</code> that does
28  * not perform any logging.
29  *
30  * @author Frank Fock
31  * @version 1.6.1
32  * @since 1.2.1
33  */

34 public class NoLogger implements LogAdapter {
35
36   static final NoLogger instance = new NoLogger();
37
38   private NoLogger() {
39   }
40
41   public void debug(Object JavaDoc message) {
42   }
43
44   public void error(Object JavaDoc message) {
45   }
46
47   public void error(Object JavaDoc message, Throwable JavaDoc t) {
48   }
49
50   public void info(Object JavaDoc message) {
51   }
52
53   public boolean isDebugEnabled() {
54     return false;
55   }
56
57   public boolean isInfoEnabled() {
58     return false;
59   }
60
61   public boolean isWarnEnabled() {
62     return false;
63   }
64
65   public void warn(Object JavaDoc message) {
66   }
67
68   public void fatal(Object JavaDoc message) {
69   }
70
71   public void fatal(Object JavaDoc message, Throwable JavaDoc throwable) {
72   }
73
74   public void setLogLevel(LogLevel level) {
75   }
76
77   public String JavaDoc getName() {
78     return "";
79   }
80
81   public LogLevel getLogLevel() {
82     return LogLevel.OFF;
83   }
84
85   public LogLevel getEffectiveLogLevel() {
86     return LogLevel.OFF;
87   }
88
89   public Iterator JavaDoc getLogHandler() {
90     return Collections.EMPTY_LIST.iterator();
91   }
92
93 }
94
Popular Tags