All Packages Class Hierarchy This Package Previous Next Index
Class sdsu.logging.Debug
java.lang.Object
|
+----sdsu.logging.Debug
- public class Debug
- extends Object
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.
- Version:
- 1.0 18 January 1998
- Author:
- Roger Whitney
(whitney@cs.sdsu.edu)
-
Debug()
-
-
fileOn(String, boolean)
- Send arguments of println() to the file listed.
-
off()
- Turn off Debug messages.
-
on()
- Turn on Debug messages.
-
println(boolean)
- Print the given message.
-
println(char)
- Print the given message.
-
println(char[])
- Print the given message.
-
println(double)
- Print the given message.
-
println(float)
- Print the given message.
-
println(int)
- Print the given message.
-
println(long)
- Print the given message.
-
println(Object)
- Print the given message.
-
println(String)
- Print the given message.
-
screenOff()
- Turn output to the screen off.
Debug
public Debug()
on
public static void on()
- Turn on Debug messages. This means that
calls to println() will be processed.
off
public static void off()
- Turn off Debug messages. This means that
calls to println() will not be processed.
screenOff
public static void screenOff()
- Turn output to the screen off. Since output
is sent to the screen by default, there is no
screenOn().
fileOn
public static void fileOn(String fileName,
boolean append) throws Exception
- Send arguments of println() to the file listed.
If the file can not be opened, a message will
be sent to the screen (standard out). No exceptions are thrown.
- Parameters:
- 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.
println
public static void println(String message)
- Print the given message.
println
public static void println(Object message)
- Print the given message.
println
public static void println(int message)
- Print the given message.
println
public static void println(char message)
- Print the given message.
println
public static void println(char message[])
- Print the given message.
println
public static void println(boolean message)
- Print the given message.
println
public static void println(long message)
- Print the given message.
println
public static void println(float message)
- Print the given message.
println
public static void println(double message)
- Print the given message.
All Packages Class Hierarchy This Package Previous Next Index