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)

Constructor Index

 o Debug()

Method Index

 o fileOn(String, boolean)
Send arguments of println() to the file listed.
 o off()
Turn off Debug messages.
 o on()
Turn on Debug messages.
 o println(boolean)
Print the given message.
 o println(char)
Print the given message.
 o println(char[])
Print the given message.
 o println(double)
Print the given message.
 o println(float)
Print the given message.
 o println(int)
Print the given message.
 o println(long)
Print the given message.
 o println(Object)
Print the given message.
 o println(String)
Print the given message.
 o screenOff()
Turn output to the screen off.

Constructors

 o Debug
 public Debug()

Methods

 o on
 public static void on()
Turn on Debug messages. This means that calls to println() will be processed.

 o off
 public static void off()
Turn off Debug messages. This means that calls to println() will not be processed.

 o screenOff
 public static void screenOff()
Turn output to the screen off. Since output is sent to the screen by default, there is no screenOn().

 o 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.
 o println
 public static void println(String message)
Print the given message.

 o println
 public static void println(Object message)
Print the given message.

 o println
 public static void println(int message)
Print the given message.

 o println
 public static void println(char message)
Print the given message.

 o println
 public static void println(char message[])
Print the given message.

 o println
 public static void println(boolean message)
Print the given message.

 o println
 public static void println(long message)
Print the given message.

 o println
 public static void println(float message)
Print the given message.

 o println
 public static void println(double message)
Print the given message.


All Packages  Class Hierarchy  This Package  Previous  Next  Index