Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Mai 10 2007 03:16:40 CEST
file stats: LOC: 400   Methods: 23
NCLOC: 187   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
Trace.java 27,3% 33,3% 52,2% 34,5%
coverage coverage
 1    /* $Id: Trace.java,v 1.1 2007/04/12 23:50:06 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.1 $
 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    *
 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  42775 public static void trace(final Object tracingObject, final String method,
 47    final Object object) {
 48  42775 final Log log = LogFactory.getFactory().getInstance(tracingObject.getClass()
 49    + "." + method);
 50  42775 if (log.isDebugEnabled()) {
 51  0 log.debug(object);
 52    }
 53    }
 54   
 55    /**
 56    * Trace object.
 57    *
 58    * @param tracingClass Class that wants to make a trace entry.
 59    * @param method Method of that class.
 60    * @param object Object to trace.
 61    */
 62  8 public static void trace(final Class tracingClass, final String method,
 63    final Object object) {
 64  8 final Log log = LogFactory.getFactory().getInstance(tracingClass
 65    + "." + method);
 66  8 if (log.isDebugEnabled()) {
 67  0 log.debug(object);
 68    }
 69    }
 70   
 71    /**
 72    * Trace throwable.
 73    *
 74    * @param tracingObject Instance that wants to make a trace entry.
 75    * @param method Method of that object.
 76    * @param throwable Throwable to trace.
 77    */
 78  18 public static void trace(final Object tracingObject, final String method,
 79    final Throwable throwable) {
 80  18 final Log log = LogFactory.getFactory().getInstance(tracingObject.getClass()
 81    + "." + method);
 82  18 if (log.isDebugEnabled()) {
 83  0 log.debug(throwable, throwable);
 84    }
 85    }
 86   
 87    /**
 88    * Trace throwable.
 89    *
 90    * @param tracingClass Class that wants to make a trace entry.
 91    * @param method Method of that class.
 92    * @param throwable Throwable to trace.
 93    */
 94  0 public static void trace(final Class tracingClass, final String method,
 95    final Throwable throwable) {
 96  0 final Log log = LogFactory.getFactory().getInstance(tracingClass
 97    + "." + method);
 98  0 if (log.isDebugEnabled()) {
 99  0 log.debug(throwable, throwable);
 100    }
 101    }
 102   
 103    /**
 104    * Trace throwable and extra description.
 105    *
 106    * @param tracingObject Instance that wants to make a trace entry.
 107    * @param method Method of that object.
 108    * @param description Further information.
 109    * @param throwable Throwable to trace.
 110    */
 111  0 public static void trace(final Object tracingObject, final String method,
 112    final String description, final Throwable throwable) {
 113  0 final Log log = LogFactory.getFactory().getInstance(tracingObject.getClass()
 114    + "." + method);
 115  0 if (log.isDebugEnabled()) {
 116  0 log.debug(description, throwable);
 117    }
 118    }
 119   
 120    /**
 121    * Trace throwable and extra description.
 122    *
 123    * @param tracingClass Class that wants to make a trace entry.
 124    * @param method Method of that class.
 125    * @param description Further information.
 126    * @param throwable Throwable to trace.
 127    */
 128  0 public static void trace(final Class tracingClass, final String method,
 129    final String description, final Throwable throwable) {
 130  0 final Log log = LogFactory.getFactory().getInstance(tracingClass
 131    + "." + method);
 132  0 if (log.isDebugEnabled()) {
 133  0 log.debug(description, throwable);
 134    }
 135    }
 136   
 137    /**
 138    * Trace method begin. Should be followed by an analogous
 139    * {@link #end(Object, String)} call.
 140    *
 141    * @param tracingObject Instance that wants to make a trace entry.
 142    * @param method Method of that object.
 143    */
 144  22914 public static void begin(final Object tracingObject, final String method) {
 145  22914 final Log log = LogFactory.getFactory().getInstance(tracingObject.getClass()
 146    + "." + method);
 147  22914 if (log.isDebugEnabled()) {
 148  0 log.debug("begin");
 149    }
 150    }
 151   
 152    /**
 153    * Trace method begin. Should be followed by an analogous {@link #end(Class, String)} call.
 154    *
 155    * @param tracingClass Class that wants to make a trace entry.
 156    * @param method Method of that class.
 157    */
 158  106 public static void begin(final Class tracingClass, final String method) {
 159  106 final Log log = LogFactory.getFactory().getInstance(tracingClass
 160    + "." + method);
 161  106 if (log.isDebugEnabled()) {
 162  0 log.debug("begin");
 163    }
 164    }
 165   
 166    /**
 167    * Trace method end.
 168    *
 169    * @param tracingObject Instance that wants to make a trace entry.
 170    * @param method Method of that object.
 171    */
 172  22731 public static void end(final Object tracingObject, final String method) {
 173  22731 final Log log = LogFactory.getFactory().getInstance(tracingObject.getClass()
 174    + "." + method);
 175  22731 if (log.isDebugEnabled()) {
 176  0 log.debug("end");
 177    }
 178    }
 179   
 180    /**
 181    * Trace method end.
 182    *
 183    * @param tracingClass Class that wants to make a trace entry.
 184    * @param method Method of that class.
 185    */
 186  106 public static void end(final Class tracingClass, final String method) {
 187  106 final Log log = LogFactory.getFactory().getInstance(tracingClass
 188    + "." + method);
 189  106 if (log.isDebugEnabled()) {
 190  0 log.debug("end");
 191    }
 192    }
 193   
 194    /**
 195    * Trace message.
 196    *
 197    * @param tracingObject Instance that wants to make a trace entry.
 198    * @param method Method of that object.
 199    * @param message Message.
 200    */
 201  300196 public static void info(final Object tracingObject, final String method,
 202    final String message) {
 203  300196 final Log log = LogFactory.getFactory().getInstance(tracingObject.getClass()
 204    + "." + method);
 205  300196 if (log.isInfoEnabled()) {
 206  0 log.info(message);
 207    }
 208    }
 209   
 210    /**
 211    * Trace method message.
 212    *
 213    * @param tracingClass Class that wants to make a trace entry.
 214    * @param method Method of that class.
 215    * @param message Message.
 216    */
 217  0 public static void info(final Class tracingClass, final String method,
 218    final String message) {
 219  0 final Log log = LogFactory.getFactory().getInstance(tracingClass
 220    + "." + method);
 221  0 if (log.isInfoEnabled()) {
 222  0 log.info(message);
 223    }
 224    }
 225   
 226    /**
 227    * Trace parameter.
 228    *
 229    * @param tracingObject Instance that wants to make a trace entry.
 230    * @param method Method of that object.
 231    * @param param Parameter to trace.
 232    * @param value Value of parameter.
 233    */
 234  6246154 public static void param(final Object tracingObject, final String method,
 235    final String param, final Object value) {
 236  6246154 final Log log = LogFactory.getFactory().getInstance(tracingObject.getClass()
 237    + "." + method);
 238  6246154 if (log.isDebugEnabled()) {
 239  0 log.debug(param + "=" + value);
 240    }
 241    }
 242   
 243    /**
 244    * Trace parameter.
 245    *
 246    * @param tracingClass Class that wants to make a trace entry.
 247    * @param method Method of that class.
 248    * @param param Parameter to trace.
 249    * @param value Value of parameter.
 250    */
 251  164 public static void param(final Class tracingClass, final String method,
 252    final String param, final Object value) {
 253  164 final Log log = LogFactory.getFactory().getInstance(tracingClass
 254    + "." + method);
 255  164 if (log.isDebugEnabled()) {
 256  0 log.debug(param + "=" + value);
 257    }
 258    }
 259   
 260    /**
 261    * Trace parameter.
 262    *
 263    * @param tracingObject Instance that wants to make a trace entry.
 264    * @param method Method of that object.
 265    * @param param Parameter to trace.
 266    * @param value Value of parameter.
 267    */
 268  14 public static void param(final Object tracingObject, final String method,
 269    final String param, final int value) {
 270  14 final Log log = LogFactory.getFactory().getInstance(tracingObject.getClass()
 271    + "." + method);
 272  14 if (log.isDebugEnabled()) {
 273  0 log.debug(param + "=" + value);
 274    }
 275    }
 276   
 277    /**
 278    * Trace parameter.
 279    *
 280    * @param tracingClass Class that wants to make a trace entry.
 281    * @param method Method of that class.
 282    * @param param Parameter to trace.
 283    * @param value Value of parameter.
 284    */
 285  0 public static void param(final Class tracingClass, final String method,
 286    final String param, final int value) {
 287  0 final Log log = LogFactory.getFactory().getInstance(tracingClass
 288    + "." + method);
 289  0 if (log.isDebugEnabled()) {
 290  0 log.debug(param + "=" + value);
 291    }
 292    }
 293   
 294    /**
 295    * Write stacktrace into trace.
 296    *
 297    * @param tracingObject Instance that wants to make a trace entry.
 298    * @param method Method of that object.
 299    */
 300  0 public static void traceStack(final Object tracingObject, final String method) {
 301  0 final Log log = LogFactory.getFactory().getInstance(tracingObject.getClass()
 302    + "." + method);
 303  0 if (!log.isDebugEnabled()) {
 304  0 return;
 305    }
 306  0 try {
 307  0 throw new Exception("Stacktrace");
 308    } catch (Exception e) {
 309  0 log.debug(e, e);
 310    }
 311    }
 312   
 313    /**
 314    * Write stacktrace into trace.
 315    *
 316    * @param tracingClass Class that wants to make a trace entry.
 317    * @param method Method of that class.
 318    */
 319  0 public static final void traceStack(final Class tracingClass, final String method) {
 320  0 final Log log = LogFactory.getFactory().getInstance(tracingClass
 321    + "." + method);
 322  0 if (!log.isDebugEnabled()) {
 323  0 return;
 324    }
 325  0 try {
 326  0 throw new Exception("Stacktrace");
 327    } catch (Exception e) {
 328  0 log.debug(e, e);
 329    }
 330    }
 331   
 332    /**
 333    * Parameter information.
 334    *
 335    * @param tracingObject Instance that wants to make an info entry.
 336    * @param method Method of that object.
 337    * @param param Parameter to trace.
 338    * @param value Value of parameter.
 339    */
 340  358108 public static void paramInfo(final Object tracingObject, final String method,
 341    final String param, final Object value) {
 342  358108 final Log log = LogFactory.getFactory().getInstance(tracingObject.getClass()
 343    + "." + method);
 344  358108 if (log.isInfoEnabled()) {
 345  0 log.info(param + "=" + value);
 346    }
 347    }
 348   
 349    /**
 350    * Parameter information.
 351    *
 352    * @param tracingClass Class that wants to make an info entry.
 353    * @param method Method of that class.
 354    * @param param Parameter to trace.
 355    * @param value Value of parameter.
 356    */
 357  0 public static void paramInfo(final Class tracingClass, final String method,
 358    final String param, final Object value) {
 359  0 final Log log = LogFactory.getFactory().getInstance(tracingClass
 360    + "." + method);
 361  0 if (log.isInfoEnabled()) {
 362  0 log.info(param + "=" + value);
 363    }
 364    }
 365   
 366    /**
 367    * Parameter information.
 368    *
 369    * @param tracingObject Instance that wants to make an info entry.
 370    * @param method Method of that object.
 371    * @param param Parameter to trace.
 372    * @param value Value of parameter.
 373    */
 374  0 public static void paramInfo(final Object tracingObject, final String method,
 375    final String param, final int value) {
 376  0 final Log log = LogFactory.getFactory().getInstance(tracingObject.getClass()
 377    + "." + method);
 378  0 if (log.isInfoEnabled()) {
 379  0 log.info(param + "=" + value);
 380    }
 381    }
 382   
 383    /**
 384    * Parameter information.
 385    *
 386    * @param tracingClass Class that wants to make an info entry.
 387    * @param method Method of that class.
 388    * @param param Parameter to trace.
 389    * @param value Value of parameter.
 390    */
 391  0 public static void paramInfo(final Class tracingClass, final String method,
 392    final String param, final int value) {
 393  0 final Log log = LogFactory.getFactory().getInstance(tracingClass
 394    + "." + method);
 395  0 if (log.isInfoEnabled()) {
 396  0 log.info(param + "=" + value);
 397    }
 398    }
 399   
 400    }