1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 package org.jomc.logging.ri.log4j;
37
38 import java.util.logging.Level;
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63 @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.4", comments = "See http://www.jomc.org/jomc/1.4/jomc-tools-1.4" )
64
65
66 public final class Log4JLogger
67 implements org.jomc.logging.Logger,
68 org.jomc.spi.Listener
69 {
70
71
72
73 @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.4", comments = "See http://www.jomc.org/jomc/1.4/jomc-tools-1.4" )
74 public Log4JLogger()
75 {
76
77 super();
78
79 }
80
81
82
83
84 public boolean isDebugEnabled()
85 {
86 return this.getLogger().isEnabledFor( org.apache.log4j.Level.DEBUG );
87 }
88
89 public void debug( final String string )
90 {
91 this.getLogger().debug( string );
92 }
93
94 public void debug( final Throwable throwable )
95 {
96 this.getLogger().debug( throwable.getMessage(), throwable );
97 }
98
99 public void debug( final String message, final Throwable throwable )
100 {
101 this.getLogger().debug( message, throwable );
102 }
103
104 public boolean isErrorEnabled()
105 {
106 return this.getLogger().isEnabledFor( org.apache.log4j.Level.ERROR );
107 }
108
109 public void error( final String string )
110 {
111 this.getLogger().error( string );
112 }
113
114 public void error( final Throwable throwable )
115 {
116 this.getLogger().error( throwable.getMessage(), throwable );
117 }
118
119 public void error( final String message, final Throwable throwable )
120 {
121 this.getLogger().error( message, throwable );
122 }
123
124 public boolean isFatalEnabled()
125 {
126 return this.getLogger().isEnabledFor( org.apache.log4j.Level.FATAL );
127 }
128
129 public void fatal( final String string )
130 {
131 this.getLogger().fatal( string );
132 }
133
134 public void fatal( final Throwable throwable )
135 {
136 this.getLogger().fatal( throwable.getMessage(), throwable );
137 }
138
139 public void fatal( final String message, final Throwable throwable )
140 {
141 this.getLogger().fatal( message, throwable );
142 }
143
144 public boolean isInfoEnabled()
145 {
146 return this.getLogger().isEnabledFor( org.apache.log4j.Level.INFO );
147 }
148
149 public void info( final String string )
150 {
151 this.getLogger().info( string );
152 }
153
154 public void info( final Throwable throwable )
155 {
156 this.getLogger().info( throwable.getMessage(), throwable );
157 }
158
159 public void info( final String message, final Throwable throwable )
160 {
161 this.getLogger().info( message, throwable );
162 }
163
164 public boolean isTraceEnabled()
165 {
166 return this.getLogger().isEnabledFor( org.apache.log4j.Level.TRACE );
167 }
168
169 public void trace( final String string )
170 {
171 this.getLogger().trace( string );
172 }
173
174 public void trace( final Throwable throwable )
175 {
176 this.getLogger().trace( throwable.getMessage(), throwable );
177 }
178
179 public void trace( final String message, final Throwable throwable )
180 {
181 this.getLogger().trace( message, throwable );
182 }
183
184 public boolean isWarnEnabled()
185 {
186 return this.getLogger().isEnabledFor( org.apache.log4j.Level.WARN );
187 }
188
189 public void warn( final String string )
190 {
191 this.getLogger().warn( string );
192 }
193
194 public void warn( final Throwable throwable )
195 {
196 this.getLogger().warn( throwable.getMessage(), throwable );
197 }
198
199 public void warn( final String message, final Throwable throwable )
200 {
201 this.getLogger().warn( message, throwable );
202 }
203
204
205
206 public void onLog( final Level level, final String message, final Throwable throwable )
207 {
208 if ( level != null )
209 {
210 if ( level.equals( Level.CONFIG ) || level.equals( Level.FINE ) )
211 {
212 this.getObjectManagementLogger().debug( message, throwable );
213 }
214 else if ( level.equals( Level.FINER ) || level.equals( Level.FINEST ) )
215 {
216 this.getObjectManagementLogger().trace( message, throwable );
217 }
218 else if ( level.equals( Level.INFO ) )
219 {
220 this.getObjectManagementLogger().info( message, throwable );
221 }
222 else if ( level.equals( Level.SEVERE ) )
223 {
224 this.getObjectManagementLogger().error( message, throwable );
225 }
226 else if ( level.equals( Level.WARNING ) )
227 {
228 this.getObjectManagementLogger().warn( message, throwable );
229 }
230 else
231 {
232 this.getObjectManagementLogger().trace( message, throwable );
233 }
234 }
235 }
236
237
238
239
240
241
242
243
244
245
246
247 public org.apache.log4j.Logger getLogger()
248 {
249 return org.apache.log4j.Logger.getLogger( this.getName() );
250 }
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281 @SuppressWarnings("unused")
282 @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.4", comments = "See http://www.jomc.org/jomc/1.4/jomc-tools-1.4" )
283 private org.jomc.logging.Logger getObjectManagementLogger()
284 {
285 final org.jomc.logging.Logger _d = (org.jomc.logging.Logger) org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getDependency( this, "ObjectManagementLogger" );
286 assert _d != null : "'ObjectManagementLogger' dependency not found.";
287 return _d;
288 }
289
290
291
292
293
294
295
296
297
298
299
300
301 @SuppressWarnings("unused")
302 @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.4", comments = "See http://www.jomc.org/jomc/1.4/jomc-tools-1.4" )
303 public java.lang.String getName()
304 {
305 final java.lang.String _p = (java.lang.String) org.jomc.ObjectManagerFactory.getObjectManager( this.getClass().getClassLoader() ).getProperty( this, "name" );
306 assert _p != null : "'name' property not found.";
307 return _p;
308 }
309
310
311
312
313 }