sophware.home.util
Class DEBUG

java.lang.Object
  extended by sophware.home.util.DEBUG

public class DEBUG
extends java.lang.Object

DEBUG provides a mechanism for embedding debug messages with different debug levels. Level zero turns off debugging, the higher the level the more verbose the messaging.


Field Summary
static int m_level
          the current debug level
static java.io.PrintStream m_outputStream
          the output stream
 
Constructor Summary
DEBUG()
           
 
Method Summary
static java.text.DateFormat getDateFormat()
          Get the date format
static boolean isAt(int level)
          Checks whether debug level is at or above given value
static void println(int level, java.lang.String message)
          Prints a debug message
static void setDateFormat(java.text.DateFormat format)
          Set the date format
static void setLevel(java.lang.String[] argv)
          Prints a debug message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_outputStream

public static java.io.PrintStream m_outputStream
the output stream


m_level

public static int m_level
the current debug level

Constructor Detail

DEBUG

public DEBUG()
Method Detail

setDateFormat

public static void setDateFormat(java.text.DateFormat format)
Set the date format

Parameters:
format - the new DateFormat
See Also:
SimpleDateFormat

getDateFormat

public static java.text.DateFormat getDateFormat()
Get the date format

Returns:
the DateFormat
See Also:
SimpleDateFormat

setLevel

public static void setLevel(java.lang.String[] argv)
Prints a debug message

Parameters:
argv - program arguments

println

public static void println(int level,
                           java.lang.String message)
Prints a debug message

Parameters:
level - the debug level of the message
message - the message

isAt

public static boolean isAt(int level)
Checks whether debug level is at or above given value

Parameters:
level - the debug level of the message