public class Debug extends 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 String |
format(String format,
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 String[] |
init(String[] args)
This routine will set the debugLevel from the arguments
pased to main().
|
static boolean |
printf(int level,
String format,
Object... args)
Print a message if the parameter level is less than or equal to
debugLevel.
|
static boolean |
printf(String format,
Object... args)
Print a message if the variable Debug.debugLevel is non-zero.
|
static void |
toFile(String fileName)
Send debugging output to a file.
|
public static int debugLevel
public static String[] init(String[] args)
args
- the array of arguments passed to mainpublic static String format(String format, 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(String format, Object... args)
format
- the format string for the outputargs
- argments for the format string (variable number)public static boolean printf(int level, String format, 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(String fileName) throws FileNotFoundException
fileName
- name of the file to send output toFileNotFoundException
public static void close()