sdsu.logging
Class Debug

java.lang.Object
  |
  +--sdsu.logging.Debug

public class Debug
extends java.lang.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 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

Debug

public Debug()
Method Detail

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(java.lang.String fileName,
                          boolean append)
                   throws java.lang.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(java.lang.String message)
Print the given message.

println

public static void println(java.lang.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.