KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > kilim > NullLoggerFactory


1 package org.objectweb.kilim;
2
3 import org.objectweb.util.monolog.api.Level;
4 import org.objectweb.util.monolog.api.Logger;
5 import org.objectweb.util.monolog.api.LoggerFactory;
6
7 /**
8  * @author delpiano
9  *
10  * A null logger, just in case the classpath of the application does not contain
11  * any lgging functionality.
12  */

13 public class NullLoggerFactory implements LoggerFactory {
14
15     private NullLogger null_logger = new NullLogger();
16     private Logger[] null_loggers = {null_logger};
17
18     /**
19      * @see org.objectweb.util.monolog.api.LoggerFactory#getLogger(String)
20      */

21     public Logger getLogger(String JavaDoc arg0) {
22         return null_logger;
23     }
24
25     /**
26      * @see org.objectweb.util.monolog.api.LoggerFactory#getLogger(String, String)
27      */

28     public Logger getLogger(String JavaDoc arg0, String JavaDoc arg1) {
29         return null_logger;
30     }
31
32     /**
33      * @see org.objectweb.util.monolog.api.LoggerFactory#getResourceBundleName()
34      */

35     public String JavaDoc getResourceBundleName() {
36         return "Null Bundle Name";
37     }
38
39     /**
40      * @see org.objectweb.util.monolog.api.LoggerFactory#setResourceBundleName(String)
41      */

42     public void setResourceBundleName(String JavaDoc arg0) {
43     }
44
45     /**
46      * @see org.objectweb.util.monolog.api.LoggerFactory#getLoggers()
47      */

48     public Logger[] getLoggers() {
49         return null_loggers;
50     }
51
52 }
53
54 class NullLogger implements Logger {
55
56     /**
57      * @see org.objectweb.util.monolog.api.Logger#getCurrentIntLevel()
58      */

59     public int getCurrentIntLevel() {
60         return 0;
61     }
62
63     /**
64      * @see org.objectweb.util.monolog.api.Logger#getCurrentLevel()
65      */

66     public Level getCurrentLevel() {
67         return null;
68     }
69
70     /**
71      * @see org.objectweb.util.monolog.api.Logger#isLoggable(int)
72      */

73     public boolean isLoggable(int arg0) {
74         return false;
75     }
76
77     /**
78      * @see org.objectweb.util.monolog.api.Logger#isLoggable(Level)
79      */

80     public boolean isLoggable(Level arg0) {
81         return false;
82     }
83
84     /**
85      * @see org.objectweb.util.monolog.api.Logger#isOn()
86      */

87     public boolean isOn() {
88         return false;
89     }
90
91     /**
92      * @see org.objectweb.util.monolog.api.Logger#log(int, Object, Object, Object)
93      */

94     public void log(int arg0, Object JavaDoc arg1, Object JavaDoc arg2, Object JavaDoc arg3) {
95     }
96
97     /**
98      * @see org.objectweb.util.monolog.api.Logger#log(int, Object, Throwable, Object, Object)
99      */

100     public void log(
101         int arg0,
102         Object JavaDoc arg1,
103         Throwable JavaDoc arg2,
104         Object JavaDoc arg3,
105         Object JavaDoc arg4) {
106     }
107
108     /**
109      * @see org.objectweb.util.monolog.api.Logger#log(int, Object, Throwable)
110      */

111     public void log(int arg0, Object JavaDoc arg1, Throwable JavaDoc arg2) {
112     }
113
114     /**
115      * @see org.objectweb.util.monolog.api.Logger#log(int, Object)
116      */

117     public void log(int arg0, Object JavaDoc arg1) {
118     }
119
120     /**
121      * @see org.objectweb.util.monolog.api.Logger#log(Level, Object, Object, Object)
122      */

123     public void log(Level arg0, Object JavaDoc arg1, Object JavaDoc arg2, Object JavaDoc arg3) {
124     }
125
126     /**
127      * @see org.objectweb.util.monolog.api.Logger#log(Level, Object, Throwable, Object, Object)
128      */

129     public void log(
130         Level arg0,
131         Object JavaDoc arg1,
132         Throwable JavaDoc arg2,
133         Object JavaDoc arg3,
134         Object JavaDoc arg4) {
135     }
136
137     /**
138      * @see org.objectweb.util.monolog.api.Logger#log(Level, Object, Throwable)
139      */

140     public void log(Level arg0, Object JavaDoc arg1, Throwable JavaDoc arg2) {
141     }
142
143     /**
144      * @see org.objectweb.util.monolog.api.Logger#log(Level, Object)
145      */

146     public void log(Level arg0, Object JavaDoc arg1) {
147     }
148
149     /**
150      * @see org.objectweb.util.monolog.api.Logger#setIntLevel(int)
151      */

152     public void setIntLevel(int arg0) {
153     }
154
155     /**
156      * @see org.objectweb.util.monolog.api.Logger#setLevel(Level)
157      */

158     public void setLevel(Level arg0) {
159     }
160
161     /**
162      * @see org.objectweb.util.monolog.api.Logger#turnOff()
163      */

164     public void turnOff() {
165     }
166
167     /**
168      * @see org.objectweb.util.monolog.api.Logger#turnOn()
169      */

170     public void turnOn() {
171     }
172
173     /**
174      * @see org.objectweb.util.monolog.api.Handler#getAttribute(String)
175      */

176     public Object JavaDoc getAttribute(String JavaDoc arg0) {
177         return null;
178     }
179
180     /**
181      * @see org.objectweb.util.monolog.api.Handler#getAttributeNames()
182      */

183     public String JavaDoc[] getAttributeNames() {
184         return null;
185     }
186
187     /**
188      * @see org.objectweb.util.monolog.api.Handler#getName()
189      */

190     public String JavaDoc getName() {
191         return null;
192     }
193
194     /**
195      * @see org.objectweb.util.monolog.api.Handler#getType()
196      */

197     public byte getType() {
198         return 0;
199     }
200
201     /**
202      * @see org.objectweb.util.monolog.api.Handler#setAttribute(String, Object)
203      */

204     public Object JavaDoc setAttribute(String JavaDoc arg0, Object JavaDoc arg1) {
205         return null;
206     }
207
208     /**
209      * @see org.objectweb.util.monolog.api.Handler#setName(String)
210      */

211     public void setName(String JavaDoc arg0) {
212     }
213
214 }
215
Popular Tags