Clover Coverage Report
Coverage timestamp: Sa Aug 2 2008 13:56:27 CEST
../../../../img/srcFileCovDistChart3.png 85% of files have more coverage
88   484   57   3,03
52   206   0,65   29
29     1,97  
1    
 
  Trace       Line # 30 88 57 30,8% 0.30769232
 
  (143)
 
1    /* $Id: Trace.java,v 1.1 2008/07/26 07:55:42 m31 Exp $
2    *
3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
4    *
5    * Copyright 2000-2008, Michael Meyling <mime@qedeq.org>.
6    *
7    * "Hilbert II" is free software; you can redistribute
8    * it and/or modify it under the terms of the GNU General Public
9    * License as published by the Free Software Foundation; either
10    * version 2 of the License, or (at your option) any later version.
11    *
12    * This program is distributed in the hope that it will be useful,
13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15    * GNU General Public License for more details.
16    */
17   
18    package org.qedeq.base.trace;
19   
20    import org.apache.commons.logging.Log;
21    import org.apache.commons.logging.LogFactory;
22   
23   
24    /**
25    * Developer trace.
26    *
27    * @version $Revision: 1.1 $
28    * @author Michael Meyling
29    */
 
30    public final class Trace {
31   
32    /**
33    * Constructor.
34    */
 
35  0 toggle private Trace() {
36    // don't call me
37    }
38   
39    /**
40    * Trace object.
41    * @param tracingClass Class that wants to make a trace entry.
42    * @param tracingObject Instance that wants to make a trace entry.
43    * @param method Method of that object.
44    * @param object Object to trace.
45    */
 
46  481471 toggle public static void trace(final Class tracingClass, final Object tracingObject,
47    final String method, final Object object) {
48  481471 final Log log = LogFactory.getFactory().getInstance(tracingClass);
49  481471 if (log.isDebugEnabled()) {
50  0 log.debug("." + method + " " + object);
51    }
52    }
53   
54    /**
55    * Trace object.
56    *
57    * @param tracingClass Class that wants to make a trace entry.
58    * @param method Method of that class.
59    * @param object Object to trace.
60    */
 
61  242549 toggle public static void trace(final Class tracingClass, final String method,
62    final Object object) {
63  242549 final Log log = LogFactory.getFactory().getInstance(tracingClass);
64  242549 if (log.isDebugEnabled()) {
65  0 log.debug("." + method + " " + object);
66    }
67    }
68   
69    /**
70    * Trace throwable.
71    *
72    * @param tracingClass Class that wants to make a trace entry.
73    * @param tracingObject Instance that wants to make a trace entry.
74    * @param method Method of that object.
75    * @param throwable Throwable to trace.
76    */
 
77  63 toggle public static void trace(final Class tracingClass, final Object tracingObject,
78    final String method, final Throwable throwable) {
79  63 final Log log = LogFactory.getFactory().getInstance(tracingClass);
80  63 if (log.isDebugEnabled()) {
81  0 log.debug("." + method + " " + throwable, throwable);
82    }
83    }
84   
85    /**
86    * Trace throwable.
87    *
88    * @param tracingClass Class that wants to make a trace entry.
89    * @param method Method of that class.
90    * @param throwable Throwable to trace.
91    */
 
92  0 toggle public static void trace(final Class tracingClass, final String method,
93    final Throwable throwable) {
94  0 final Log log = LogFactory.getFactory().getInstance(tracingClass);
95  0 if (log.isDebugEnabled()) {
96  0 log.debug("." + method + " " + throwable, throwable);
97    }
98    }
99   
100    /**
101    * Trace fatal throwable and extra description.
102    *
103    * @param tracingClass Class that wants to make a trace entry.
104    * @param tracingObject Instance that wants to make a trace entry.
105    * @param method Method of that object.
106    * @param description Further information.
107    * @param throwable Throwable to trace.
108    */
 
109  0 toggle public static void fatal(final Class tracingClass, final Object tracingObject,
110    final String method, final String description, final Throwable throwable) {
111  0 final Log log = LogFactory.getFactory().getInstance(tracingClass);
112  0 log.fatal("." + method + " " + description, throwable);
113    }
114   
115    /**
116    * Trace fatal throwable and extra description.
117    *
118    * @param tracingClass Class that wants to make a trace entry.
119    * @param method Method of that class.
120    * @param description Further information.
121    * @param throwable Throwable to trace.
122    */
 
123  0 toggle public static void fatal(final Class tracingClass, final String method,
124    final String description, final Throwable throwable) {
125  0 final Log log = LogFactory.getFactory().getInstance(tracingClass);
126  0 log.fatal("." + method + " " + description, throwable);
127    }
128   
129    /**
130    * Trace throwable and extra description.
131    *
132    * @param tracingClass Class that wants to make a trace entry.
133    * @param tracingObject Instance that wants to make a trace entry.
134    * @param method Method of that object.
135    * @param description Further information.
136    * @param throwable Throwable to trace.
137    */
 
138  0 toggle public static void trace(final Class tracingClass, final Object tracingObject,
139    final String method, final String description, final Throwable throwable) {
140  0 final Log log = LogFactory.getFactory().getInstance(tracingClass);
141  0 if (log.isDebugEnabled()) {
142  0 log.debug("." + method + " " + description, throwable);
143    }
144    }
145   
146    /**
147    * Trace throwable and extra description.
148    *
149    * @param tracingClass Class that wants to make a trace entry.
150    * @param method Method of that class.
151    * @param description Further information.
152    * @param throwable Throwable to trace.
153    */
 
154  0 toggle public static void trace(final Class tracingClass, final String method,
155    final String description, final Throwable throwable) {
156  0 final Log log = LogFactory.getFactory().getInstance(tracingClass);
157  0 if (log.isDebugEnabled()) {
158  0 log.debug("." + method + " " + description, throwable);
159    }
160    }
161   
162    /**
163    * Trace method begin. Should be followed by an analogous
164    * {@link #end(Class, Object, String)} call.
165    *
166    * @param tracingClass Class that wants to make a trace entry.
167    * @param tracingObject Instance that wants to make a trace entry.
168    * @param method Method of that object.
169    */
 
170  26782 toggle public static void begin(final Class tracingClass, final Object tracingObject,
171    final String method) {
172  26782 final Log log = LogFactory.getFactory().getInstance(tracingClass);
173  26782 if (log.isDebugEnabled()) {
174  0 log.debug("." + method + " " + "begin");
175    }
176    }
177   
178    /**
179    * Trace method begin. Should be followed by an analogous {@link #end(Class, String)} call.
180    *
181    * @param tracingClass Class that wants to make a trace entry.
182    * @param method Method of that class.
183    */
 
184  113 toggle public static void begin(final Class tracingClass, final String method) {
185  113 final Log log = LogFactory.getFactory().getInstance(tracingClass);
186  113 if (log.isDebugEnabled()) {
187  0 log.debug("." + method + " " + "begin");
188    }
189    }
190   
191    /**
192    * Trace method end.
193    *
194    * @param tracingClass Class that wants to make a trace entry.
195    * @param tracingObject Instance that wants to make a trace entry.
196    * @param method Method of that object.
197    */
 
198  26734 toggle public static void end(final Class tracingClass, final Object tracingObject,
199    final String method) {
200  26734 final Log log = LogFactory.getFactory().getInstance(tracingClass);
201  26734 if (log.isDebugEnabled()) {
202  0 log.debug("." + method + " " + "end");
203    }
204    }
205   
206    /**
207    * Trace method end.
208    *
209    * @param tracingClass Class that wants to make a trace entry.
210    * @param method Method of that class.
211    */
 
212  113 toggle public static void end(final Class tracingClass, final String method) {
213  113 final Log log = LogFactory.getFactory().getInstance(tracingClass);
214  113 if (log.isDebugEnabled()) {
215  0 log.debug("." + method + " " + "end");
216    }
217    }
218   
219    /**
220    * Trace message.
221    *
222    * @param tracingClass Class that wants to make a trace entry.
223    * @param tracingObject Instance that wants to make a trace entry.
224    * @param method Method of that object.
225    * @param message Message.
226    */
 
227  338748 toggle public static void info(final Class tracingClass, final Object tracingObject,
228    final String method, final String message) {
229  338748 final Log log = LogFactory.getFactory().getInstance(tracingClass);
230  338748 if (log.isInfoEnabled()) {
231  0 log.info("." + method + " " + message);
232    }
233    }
234   
235    /**
236    * Trace method message.
237    *
238    * @param tracingClass Class that wants to make a trace entry.
239    * @param method Method of that class.
240    * @param message Message.
241    */
 
242  0 toggle public static void info(final Class tracingClass, final String method,
243    final String message) {
244  0 final Log log = LogFactory.getFactory().getInstance(tracingClass);
245  0 if (log.isInfoEnabled()) {
246  0 log.info("." + method + " " + message);
247    }
248    }
249   
250    /**
251    * Trace parameter.
252    *
253    * @param tracingClass Class that wants to make a trace entry.
254    * @param tracingObject Instance that wants to make a trace entry.
255    * @param method Method of that object.
256    * @param param Parameter to trace.
257    * @param value Value of parameter.
258    */
 
259  7472173 toggle public static void param(final Class tracingClass, final Object tracingObject,
260    final String method, final String param, final Object value) {
261  7472173 final Log log = LogFactory.getFactory().getInstance(tracingClass);
262  7472173 if (log.isDebugEnabled()) {
263  0 log.debug("." + method + " " + param + "=" + value);
264    }
265    }
266   
267    /**
268    * Trace parameter.
269    *
270    * @param tracingClass Class that wants to make a trace entry.
271    * @param method Method of that class.
272    * @param param Parameter to trace.
273    * @param value Value of parameter.
274    */
 
275  527454 toggle public static void param(final Class tracingClass, final String method,
276    final String param, final Object value) {
277  527454 final Log log = LogFactory.getFactory().getInstance(tracingClass);
278  527454 if (log.isDebugEnabled()) {
279  0 log.debug("." + method + " " + param + "=" + value);
280    }
281    }
282   
283    /**
284    * Trace parameter.
285    *
286    * @param tracingClass Class that wants to make a trace entry.
287    * @param tracingObject Instance that wants to make a trace entry.
288    * @param method Method of that object.
289    * @param param Parameter to trace.
290    * @param value Value of parameter.
291    */
 
292  110126 toggle public static void param(final Class tracingClass, final Object tracingObject,
293    final String method, final String param, final int value) {
294  110126 final Log log = LogFactory.getFactory().getInstance(tracingClass);
295  110126 if (log.isDebugEnabled()) {
296  0 log.debug("." + method + " " + param + "=" + value);
297    }
298    }
299   
300    /**
301    * Trace parameter.
302    *
303    * @param tracingClass Class that wants to make a trace entry.
304    * @param method Method of that class.
305    * @param param Parameter to trace.
306    * @param value Value of parameter.
307    */
 
308  0 toggle public static void param(final Class tracingClass, final String method,
309    final String param, final int value) {
310  0 final Log log = LogFactory.getFactory().getInstance(tracingClass);
311  0 if (log.isDebugEnabled()) {
312  0 log.debug("." + method + " " + param + "=" + value);
313    }
314    }
315   
316    /**
317    * Trace parameter.
318    *
319    * @param tracingClass Class that wants to make a trace entry.
320    * @param tracingObject Instance that wants to make a trace entry.
321    * @param method Method of that object.
322    * @param param Parameter to trace.
323    * @param value Value of parameter.
324    */
 
325  147 toggle public static void param(final Class tracingClass, final Object tracingObject,
326    final String method, final String param, final boolean value) {
327  147 final Log log = LogFactory.getFactory().getInstance(tracingClass);
328  147 if (log.isDebugEnabled()) {
329  0 log.debug("." + method + " " + param + "=" + value);
330    }
331    }
332   
333    /**
334    * Trace parameter.
335    *
336    * @param tracingClass Class that wants to make a trace entry.
337    * @param method Method of that class.
338    * @param param Parameter to trace.
339    * @param value Value of parameter.
340    */
 
341  0 toggle public static void param(final Class tracingClass, final String method,
342    final String param, final boolean value) {
343  0 final Log log = LogFactory.getFactory().getInstance(tracingClass);
344  0 if (log.isDebugEnabled()) {
345  0 log.debug("." + method + " " + param + "=" + value);
346    }
347    }
348   
349    /**
350    * Write stacktrace into trace.
351    *
352    * @param tracingClass Class that wants to make a trace entry.
353    * @param tracingObject Instance that wants to make a trace entry.
354    * @param method Method of that object.
355    */
 
356  0 toggle public static void traceStack(final Class tracingClass, final Object tracingObject,
357    final String method) {
358  0 final Log log = LogFactory.getFactory().getInstance(tracingClass);
359  0 if (!log.isDebugEnabled()) {
360  0 return;
361    }
362  0 try {
363  0 throw new Exception("Stacktrace");
364    } catch (Exception e) {
365  0 log.debug("." + method + " " + e, e);
366    }
367    }
368   
369    /**
370    * Write stacktrace into trace.
371    *
372    * @param tracingClass Class that wants to make a trace entry.
373    * @param method Method of that class.
374    */
 
375  0 toggle public static final void traceStack(final Class tracingClass, final String method) {
376  0 final Log log = LogFactory.getFactory().getInstance(tracingClass);
377  0 if (!log.isDebugEnabled()) {
378  0 return;
379    }
380  0 try {
381  0 throw new Exception("Stacktrace");
382    } catch (Exception e) {
383  0 log.debug("." + method + " " + e, e);
384    }
385    }
386   
387    /**
388    * Parameter information.
389    *
390    * @param tracingClass Class that wants to make a trace entry.
391    * @param tracingObject Instance that wants to make an info entry.
392    * @param method Method of that object.
393    * @param param Parameter to trace.
394    * @param value Value of parameter.
395    */
 
396  437068 toggle public static void paramInfo(final Class tracingClass, final Object tracingObject,
397    final String method, final String param, final Object value) {
398  437068 final Log log = LogFactory.getFactory().getInstance(tracingClass);
399  437068 if (log.isInfoEnabled()) {
400  0 log.info("." + method + " " + param + "=" + value);
401    }
402    }
403   
404    /**
405    * Parameter information.
406    *
407    * @param tracingClass Class that wants to make an info entry.
408    * @param method Method of that class.
409    * @param param Parameter to trace.
410    * @param value Value of parameter.
411    */
 
412  0 toggle public static void paramInfo(final Class tracingClass, final String method,
413    final String param, final Object value) {
414  0 final Log log = LogFactory.getFactory().getInstance(tracingClass);
415  0 if (log.isInfoEnabled()) {
416  0 log.info("." + method + " " + param + "=" + value);
417    }
418    }
419   
420    /**
421    * Parameter information.
422    * @param tracingClass Class that wants to make an info entry.
423    * @param tracingObject Instance that wants to make an info entry.
424    * @param method Method of that object.
425    * @param param Parameter to trace.
426    * @param value Value of parameter.
427    */
 
428  0 toggle public static void paramInfo(final Class tracingClass, final Object tracingObject,
429    final String method, final String param, final int value) {
430  0 final Log log = LogFactory.getFactory().getInstance(tracingClass);
431  0 if (log.isInfoEnabled()) {
432  0 log.info("." + method + " " + param + "=" + value);
433    }
434    }
435   
436    /**
437    * Parameter information.
438    *
439    * @param tracingClass Class that wants to make an info entry.
440    * @param method Method of that class.
441    * @param param Parameter to trace.
442    * @param value Value of parameter.
443    */
 
444  0 toggle public static void paramInfo(final Class tracingClass, final String method,
445    final String param, final int value) {
446  0 final Log log = LogFactory.getFactory().getInstance(tracingClass);
447  0 if (log.isInfoEnabled()) {
448  0 log.info("." + method + " " + param + "=" + value);
449    }
450    }
451   
452    /**
453    * Parameter information.
454    * @param tracingClass Class that wants to make an info entry.
455    * @param tracingObject Instance that wants to make an info entry.
456    * @param method Method of that object.
457    * @param param Parameter to trace.
458    * @param value Value of parameter.
459    */
 
460  0 toggle public static void paramInfo(final Class tracingClass, final Object tracingObject,
461    final String method, final String param, final boolean value) {
462  0 final Log log = LogFactory.getFactory().getInstance(tracingClass);
463  0 if (log.isInfoEnabled()) {
464  0 log.info("." + method + " " + param + "=" + value);
465    }
466    }
467   
468    /**
469    * Parameter information.
470    *
471    * @param tracingClass Class that wants to make an info entry.
472    * @param method Method of that class.
473    * @param param Parameter to trace.
474    * @param value Value of parameter.
475    */
 
476  0 toggle public static void paramInfo(final Class tracingClass, final String method,
477    final String param, final boolean value) {
478  0 final Log log = LogFactory.getFactory().getInstance(tracingClass);
479  0 if (log.isInfoEnabled()) {
480  0 log.info("." + method + " " + param + "=" + value);
481    }
482    }
483   
484    }