Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Sa Jan 26 2008 14:11:34 CET
file stats: LOC: 452   Methods: 27
NCLOC: 192   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
Trace.java 56,2% 53,7% 55,6% 54,8%
coverage coverage
 1    /* $Id: Trace.java,v 1.5 2008/01/26 12:39:09 m31 Exp $
 2    *
 3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
 4    *
 5    * Copyright 2000-2007, 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.kernel.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.5 $
 28    * @author Michael Meyling
 29    */
 30    public final class Trace {
 31   
 32    /**
 33    * Constructor.
 34    */
 35  0 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  478869 public static void trace(final Class tracingClass, final Object tracingObject,
 47    final String method, final Object object) {
 48  478869 final Log log = LogFactory.getFactory().getInstance(tracingClass);
 49  478869 if (log.isDebugEnabled()) {
 50  474092 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  160157 public static void trace(final Class tracingClass, final String method,
 62    final Object object) {
 63  160157 final Log log = LogFactory.getFactory().getInstance(tracingClass);
 64  160157 if (log.isDebugEnabled()) {
 65  160157 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  109 public static void trace(final Class tracingClass, final Object tracingObject,
 78    final String method, final Throwable throwable) {
 79  109 final Log log = LogFactory.getFactory().getInstance(tracingClass);
 80  109 if (log.isDebugEnabled()) {
 81  49 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  14 public static void trace(final Class tracingClass, final String method,
 93    final Throwable throwable) {
 94  14 final Log log = LogFactory.getFactory().getInstance(tracingClass);
 95  14 if (log.isDebugEnabled()) {
 96  5 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  1 public static void fatal(final Class tracingClass, final Object tracingObject,
 110    final String method, final String description, final Throwable throwable) {
 111  1 final Log log = LogFactory.getFactory().getInstance(tracingClass);
 112  1 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 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 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 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  30875 public static void begin(final Class tracingClass, final Object tracingObject,
 171    final String method) {
 172  30875 final Log log = LogFactory.getFactory().getInstance(tracingClass);
 173  30875 if (log.isDebugEnabled()) {
 174  23051 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  126 public static void begin(final Class tracingClass, final String method) {
 185  126 final Log log = LogFactory.getFactory().getInstance(tracingClass);
 186  126 if (log.isDebugEnabled()) {
 187  107 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  30428 public static void end(final Class tracingClass, final Object tracingObject,
 199    final String method) {
 200  30428 final Log log = LogFactory.getFactory().getInstance(tracingClass);
 201  30428 if (log.isDebugEnabled()) {
 202  22832 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  126 public static void end(final Class tracingClass, final String method) {
 213  126 final Log log = LogFactory.getFactory().getInstance(tracingClass);
 214  126 if (log.isDebugEnabled()) {
 215  107 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  334048 public static void info(final Class tracingClass, final Object tracingObject,
 228    final String method, final String message) {
 229  334048 final Log log = LogFactory.getFactory().getInstance(tracingClass);
 230  334048 if (log.isInfoEnabled()) {
 231  333867 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 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  7882579 public static void param(final Class tracingClass, final Object tracingObject,
 260    final String method, final String param, final Object value) {
 261  7882912 final Log log = LogFactory.getFactory().getInstance(tracingClass);
 262  7883193 if (log.isDebugEnabled()) {
 263  7328939 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  520858 public static void param(final Class tracingClass, final String method,
 276    final String param, final Object value) {
 277  520858 final Log log = LogFactory.getFactory().getInstance(tracingClass);
 278  520858 if (log.isDebugEnabled()) {
 279  520770 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  223723 public static void param(final Class tracingClass, final Object tracingObject,
 293    final String method, final String param, final int value) {
 294  223723 final Log log = LogFactory.getFactory().getInstance(tracingClass);
 295  223734 if (log.isDebugEnabled()) {
 296  143795 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 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  7190 public static void param(final Class tracingClass, final Object tracingObject,
 326    final String method, final String param, final boolean value) {
 327  7190 final Log log = LogFactory.getFactory().getInstance(tracingClass);
 328  7190 if (log.isDebugEnabled()) {
 329  87 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 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 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 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  398155 public static void paramInfo(final Class tracingClass, final Object tracingObject,
 397    final String method, final String param, final Object value) {
 398  398155 final Log log = LogFactory.getFactory().getInstance(tracingClass);
 399  398155 if (log.isInfoEnabled()) {
 400  397927 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 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 TODO
 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 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 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    }