FileDocCategorySizeDatePackage
Debug.javaAPI DocExample1005Thu Mar 29 14:05:38 BST 2001com.darwinsys.util

Debug

public class Debug extends Object
Utilities for debugging
author
Ian Darwin, ian@darwinsys.com
version
$Id: Debug.java,v 1.7 2001/03/29 18:05:38 ian Exp $

Fields Summary
Constructors Summary
Methods Summary
public static booleanisEnabled(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. Use like this:
if (Debug.isEnabled("fileio"))
System.out.println("Starting to read file " + fileName);

		return System.getProperty("debug." + category) != null;
	
public static voidprintln(java.lang.String category, java.lang.String msg)
Static method to println a given message if the given category is enabled for debugging.

		if (isEnabled(category))
			System.out.println(msg);
	
public static voidprintln(java.lang.String category, java.lang.Object stuff)
Same thing but for non-String objects (think of the other form as an optimization of this).

		println(category, stuff.toString());