|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.nite.util.Debug
public class Debug
A simple utility for controlling printed messages. Five levels of information are defined and users can set the PrintStream on which messages are printed. The levels of output are:
Field Summary | |
---|---|
static int |
DEBUG
|
static int |
ERROR
|
static int |
IMPORTANT
|
static int |
NO_MESSAGES
|
static int |
PROGRAMMER
|
static int |
WARNING
|
Constructor Summary | |
---|---|
Debug()
|
Method Summary | |
---|---|
static int |
getDebugLevel()
Return true if debugging is on, false otherwise |
static java.io.PrintStream |
getStream()
Switch the output PrintStream |
static boolean |
isDebugging()
Return true if debugging is on, false otherwise |
static void |
print(java.lang.String message)
Print a debug message to the appropriate output stream - this version has no debug level, so we assume it's at WARNING level. |
static void |
print(java.lang.String message,
int level)
Print a debug message to the appropriate output stream - if the level given is at least equal to out current debug level. |
static void |
setDebug(boolean level)
Switch debugging to default level (WARNINGS) if true or completely off if false |
static void |
setDebug(int level)
Switch debugging to the given level |
static void |
setStream(java.io.PrintStream str)
Switch the output PrintStream |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NO_MESSAGES
public static final int ERROR
public static final int IMPORTANT
public static final int WARNING
public static final int DEBUG
public static final int PROGRAMMER
Constructor Detail |
---|
public Debug()
Method Detail |
---|
public static void setDebug(boolean level)
public static void setDebug(int level)
public static boolean isDebugging()
public static int getDebugLevel()
public static void setStream(java.io.PrintStream str)
public static java.io.PrintStream getStream()
public static void print(java.lang.String message, int level)
message
- the debug message.level
- the debug level of this message.public static void print(java.lang.String message)
message
- the debug message.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |