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.
|
static java.lang.String |
prefix
Define prefix of flag to turn on debugging
|
private static java.io.PrintStream |
ps
A variable to allow debug output to go someplace other than
System.err.
|
| Modifier | Constructor and Description |
|---|---|
private |
Debug()
Purely static, no instances may be created
|
| 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 initialize the class from the arguments
passed 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.
|
private static void |
printIt(java.lang.String format,
java.lang.Object... args)
Print the output prefix "DEBUG fileName[lineNumber] methodName"
|
static void |
toFile(java.lang.String fileName)
Send debugging output to a file.
|
public static final java.lang.String prefix
public static int debugLevel
private static java.io.PrintStream ps
public static java.lang.String[] init(java.lang.String[] args)
args - the array of arguments passed to main()private static void printIt(java.lang.String format,
java.lang.Object... args)
format - the format string for the outputargs - arguments for the format string (variable number)public 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 - arguments 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 - arguments 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 - arguments 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.FileNotFoundExceptionpublic static void close()