|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sdsu.logging.Debug
This class is to be used in debuging programs. It has several advantages over using System.out. First, the debug statements can be turn off globally. This means you can leave the debug statments in the program, without them producing output. Second, each debug statement prints the line number where is was called from. Third, the debug output can be directed to the screen and/or a file. Fourth, the underlying stream is flushed after each println to that insure the output is processed before a program crashes. Debug output can be sent to the screen or a file. Default action is to send output to the screen.
To use the Debug class, just use the statement:
Debug.println( "Your debug message here");where you wish to print out debug messages.
Constructor Summary | |
Debug()
|
Method Summary | |
static void |
fileOn(java.lang.String fileName,
boolean append)
Send arguments of println() to the file listed. |
static void |
off()
Turn off Debug messages. |
static void |
on()
Turn on Debug messages. |
static void |
println(boolean message)
Print the given message. |
static void |
println(char message)
Print the given message. |
static void |
println(char[] message)
Print the given message. |
static void |
println(double message)
Print the given message. |
static void |
println(float message)
Print the given message. |
static void |
println(int message)
Print the given message. |
static void |
println(long message)
Print the given message. |
static void |
println(java.lang.Object message)
Print the given message. |
static void |
println(java.lang.String message)
Print the given message. |
static void |
screenOff()
Turn output to the screen off. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Debug()
Method Detail |
public static void on()
public static void off()
public static void screenOff()
public static void fileOn(java.lang.String fileName, boolean append) throws java.lang.Exception
fileName
- the file to be used to write
the logging messages.append
- if true then the file is opened in
append mode, if false overwrite the file.public static void println(java.lang.String message)
public static void println(java.lang.Object message)
public static void println(int message)
public static void println(char message)
public static void println(char[] message)
public static void println(boolean message)
public static void println(long message)
public static void println(float message)
public static void println(double message)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |