Package com.mckoi.debug
Class Debug
- java.lang.Object
-
- com.mckoi.debug.Debug
-
public final class Debug extends java.lang.Object
Deprecated.use DebugLogger implementations instead.This is a static class that should be used to output debugging information. Since all debug messages go through this class, we can easily turn the messages on and off, or specify output of different levels of debugging information. We can also filter out the debugging information and output it to different output streams.
-
-
Field Summary
Fields Modifier and Type Field Description static int
ALERT
Deprecated.(package private) static int
debug_level
Deprecated.This variable specifies the level of debugging information that is output.private static java.lang.Object
debug_lock
Deprecated.The debug lock object.(package private) static java.io.PrintWriter
err
Deprecated.The print stream where the error information is output to.static int
ERROR
Deprecated.private static boolean
EXCEPTIONS_TO_ERR
Deprecated.Set this to true to output all exceptions to System.err.static int
INFORMATION
Deprecated.Some sample debug levels.static int
MESSAGE
Deprecated.(package private) static java.io.PrintWriter
out
Deprecated.The print stream where the debugging information is output to.private static boolean
PRINT_ALERT_TO_MESSAGES
Deprecated.Set this to true if all alerts to messages are to be output to System.out.(package private) static java.io.PrintWriter
SYSTEM_ERR
Deprecated.The PrintWriter for the system error stream.(package private) static java.io.PrintWriter
SYSTEM_OUT
Deprecated.The PrintWriter for the system output stream.static int
WARNING
Deprecated.
-
Constructor Summary
Constructors Constructor Description Debug()
Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private static void
internalWrite(java.io.PrintWriter out, int level, java.lang.String class_string, java.lang.String message)
Deprecated.Internal method that writes out the given information on the output stream provided.static boolean
isInterestedIn(int level)
Deprecated.Queries the current debug level.static void
listenToEventDispatcher()
Deprecated.Sets up the system so that the debug messenger will intercept event dispatch errors and output the event to the debug stream.static void
setDebugLevel(int level)
Deprecated.Sets the debug level that's to be output to the stream.static void
setOutput(java.io.Writer out)
Deprecated.Sets up the OutputStream to which the debug information is to be output to.static void
write(int level, java.lang.Class cla, java.lang.String message)
Deprecated.static void
write(int level, java.lang.Object ob, java.lang.String message)
Deprecated.This writes the given debugging string.static void
write(int level, java.lang.String class_string, java.lang.String message)
Deprecated.static void
write(java.lang.Object ob, java.lang.String message)
Deprecated.this is a legacy debug method.static void
writeException(int level, java.lang.Throwable e)
Deprecated.This writes the given Exception but gives it a 'debug_level'.static void
writeException(java.lang.Throwable e)
Deprecated.This writes the given Exception.private static void
writeTime()
Deprecated.Writes out the time to the debug stream.
-
-
-
Field Detail
-
PRINT_ALERT_TO_MESSAGES
private static final boolean PRINT_ALERT_TO_MESSAGES
Deprecated.Set this to true if all alerts to messages are to be output to System.out. The purpose of this flag is to aid debugging.- See Also:
- Constant Field Values
-
EXCEPTIONS_TO_ERR
private static final boolean EXCEPTIONS_TO_ERR
Deprecated.Set this to true to output all exceptions to System.err.- See Also:
- Constant Field Values
-
INFORMATION
public static final int INFORMATION
Deprecated.Some sample debug levels.- See Also:
- Constant Field Values
-
WARNING
public static final int WARNING
Deprecated.- See Also:
- Constant Field Values
-
ALERT
public static final int ALERT
Deprecated.- See Also:
- Constant Field Values
-
ERROR
public static final int ERROR
Deprecated.- See Also:
- Constant Field Values
-
MESSAGE
public static final int MESSAGE
Deprecated.- See Also:
- Constant Field Values
-
debug_lock
private static final java.lang.Object debug_lock
Deprecated.The debug lock object.
-
SYSTEM_OUT
static final java.io.PrintWriter SYSTEM_OUT
Deprecated.The PrintWriter for the system output stream.
-
SYSTEM_ERR
static final java.io.PrintWriter SYSTEM_ERR
Deprecated.The PrintWriter for the system error stream.
-
debug_level
static int debug_level
Deprecated.This variable specifies the level of debugging information that is output. Any debugging output above this level is output.
-
out
static java.io.PrintWriter out
Deprecated.The print stream where the debugging information is output to.
-
err
static java.io.PrintWriter err
Deprecated.The print stream where the error information is output to.
-
-
Method Detail
-
internalWrite
private static final void internalWrite(java.io.PrintWriter out, int level, java.lang.String class_string, java.lang.String message)
Deprecated.Internal method that writes out the given information on the output stream provided.
-
setOutput
public static final void setOutput(java.io.Writer out)
Deprecated.Sets up the OutputStream to which the debug information is to be output to.
-
setDebugLevel
public static final void setDebugLevel(int level)
Deprecated.Sets the debug level that's to be output to the stream. Set to 255 to stop all output to the stream.
-
listenToEventDispatcher
public static final void listenToEventDispatcher()
Deprecated.Sets up the system so that the debug messenger will intercept event dispatch errors and output the event to the debug stream.
-
isInterestedIn
public static final boolean isInterestedIn(int level)
Deprecated.Queries the current debug level. Returns true if the debug listener is interested in debug information of this given level. This can be used to speed up certain complex debug displaying operations where the debug listener isn't interested in the information be presented.
-
write
public static final void write(int level, java.lang.Object ob, java.lang.String message)
Deprecated.This writes the given debugging string. It filters out any messages that are below the 'debug_level' variable. The 'object' variable specifies the object that made the call. 'level' must be between 0 and 255. A message of 'level' 255 will always print.
-
write
public static final void write(int level, java.lang.Class cla, java.lang.String message)
Deprecated.
-
write
public static final void write(int level, java.lang.String class_string, java.lang.String message)
Deprecated.
-
write
public static final void write(java.lang.Object ob, java.lang.String message)
Deprecated.this is a legacy debug method.
-
writeTime
private static final void writeTime()
Deprecated.Writes out the time to the debug stream.
-
writeException
public static final void writeException(java.lang.Throwable e)
Deprecated.This writes the given Exception. Exceptions are always output to the log stream.
-
writeException
public static final void writeException(int level, java.lang.Throwable e)
Deprecated.This writes the given Exception but gives it a 'debug_level'. This is so we can write out a warning exception.
-
-