com.darwinsys.util
Class Debug

java.lang.Object
  extended by com.darwinsys.util.Debug

public class Debug
extends java.lang.Object

Utilities for debugging

Version:
$Id: Debug.java,v 1.9 2006/06/28 02:31:13 ian Exp $
Author:
Ian Darwin, http://www.darwinsys.com/

Constructor Summary
Debug()
           
 
Method Summary
static boolean isEnabled(java.lang.String category)
          Static method to see if a given category of debugging is enabled.
static void printf(java.lang.String category, java.lang.String format, java.lang.Object... objects)
          Invoke System.out.printf if and only if the given category is enabled for debugging, as reported by isEnabled.
static void println(java.lang.String category, java.lang.Object stuff)
          Static method to println an arbitrary Object if the given category is enabled for debugging, as reported by isEnabled.
static void println(java.lang.String category, java.lang.String msg)
          Static method to println a given message if the given category is enabled for debugging, as reported by isEnabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Debug

public Debug()
Method Detail

isEnabled

public static boolean isEnabled(java.lang.String category)
Static method to see if a given category of debugging is enabled. Enable by setting e.g., -Ddebug.fileio to debug file I/O operations. For example:
if (Debug.isEnabled("fileio"))
System.out.println("Starting to read file " + fileName);


println

public static void println(java.lang.String category,
                           java.lang.String msg)
Static method to println a given message if the given category is enabled for debugging, as reported by isEnabled.


println

public static void println(java.lang.String category,
                           java.lang.Object stuff)
Static method to println an arbitrary Object if the given category is enabled for debugging, as reported by isEnabled.


printf

public static void printf(java.lang.String category,
                          java.lang.String format,
                          java.lang.Object... objects)
Invoke System.out.printf if and only if the given category is enabled for debugging, as reported by isEnabled.



Copyright © 1996-2004 Ian F. Darwin. See license.html for usage license.