public class Debug
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
debugLevel
A variable controlling how much debug output is produced.
|
Modifier and Type | Method and Description |
---|---|
static void |
close()
Close the output stream if it is not System.err.
|
static java.lang.String |
format(java.lang.String format,
java.lang.Object... args)
An "extension" of String.format() to automatically convert
arrays to Strings using the Arrays.toString() methods.
|
static boolean |
HERE()
Simple routine to print the fileName, lineNumber and methodName.
|
static java.lang.String[] |
init(java.lang.String[] args)
This routine will set the debugLevel from the arguments
pased to main().
|
static boolean |
printf(int level,
java.lang.String format,
java.lang.Object... args)
Print a message if the parameter level is less than or equal to
debugLevel.
|
static boolean |
printf(java.lang.String format,
java.lang.Object... args)
Print a message if the variable Debug.debugLevel is non-zero.
|
static void |
toFile(java.lang.String fileName)
Send debugging output to a file.
|
public static int debugLevel
public static java.lang.String[] init(java.lang.String[] args)
args
- the array of arguments passed to mainpublic static java.lang.String format(java.lang.String format, java.lang.Object... args)
format
- the format string for the output (use %s for arrays)args
- argments for the format string (variable number)public static boolean HERE()
public static boolean printf(java.lang.String format, java.lang.Object... args)
format
- the format string for the outputargs
- argments for the format string (variable number)public static boolean printf(int level, java.lang.String format, java.lang.Object... args)
level
- controls whether message is printed or notformat
- the format string for the outputargs
- argments for the format string (variable number)public static void toFile(java.lang.String fileName) throws java.io.FileNotFoundException
fileName
- name of the file to send output tojava.io.FileNotFoundException
public static void close()