|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunsw.cse.mica.util.Debug
public class Debug
A simple debug utility, implemented as a static class. It controls where debugging output goes as well as the level of debugging output. The lower the debug level, the fewer debug messages are printed.
Field Summary | |
---|---|
static int |
DEFAULT_LEVEL
|
static int |
EMERGENCY
|
static int |
EVERYTHING
|
static int |
FN_CALLS
|
static int |
FN_PARAMS
|
static int |
IMPORTANT
|
static int |
INFORMATION
|
static int |
PROGRESS
|
static int |
TRACE
|
Constructor Summary | |
---|---|
Debug()
|
Method Summary | |
---|---|
static void |
dp(int level,
java.lang.String str)
Prints a debug message, depending on the value of debug level. |
static void |
dpnl(int level,
java.lang.String str)
Prints a multi-line debug message, depending on the value of debug level. |
static int |
getDebugLevel()
Get the current debug level |
static int |
getDebugLevel(java.lang.String level)
Get the debug level for a given string. |
static java.io.PrintStream |
getDebugOut()
Gets the current debug output. |
static void |
myassert(boolean assertion,
int l,
java.lang.String str)
An assertion-based error print. |
static void |
myassert(boolean assertion,
java.lang.String str)
An assertion-based error print. |
static void |
setDebugLevel(int debugLvl)
Set the maximum debug levels. |
static void |
setDebugOut(java.io.PrintStream p)
Sets the place where all the debug messages go. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int EMERGENCY
public static final int IMPORTANT
public static final int INFORMATION
public static final int PROGRESS
public static final int FN_CALLS
public static final int FN_PARAMS
public static final int TRACE
public static final int EVERYTHING
public static final int DEFAULT_LEVEL
Constructor Detail |
---|
public Debug()
Method Detail |
---|
public static int getDebugLevel(java.lang.String level)
level
- The string representation of the level. must be one of
"emergency",
"important",
"information",
"progress",
"fn_calls",
"fn_params",
"trace" or
"everything".
public static void setDebugLevel(int debugLvl)
dp(dl, s)
method call will only print if it is less than or equal to this
level. As a convention, debugLevel 0 should not print any
extraneous messages.
debugLvl
- New debug level.public static int getDebugLevel()
public static void setDebugOut(java.io.PrintStream p)
p
- The PrintStream used to print outputs to.public static java.io.PrintStream getDebugOut()
public static void dp(int level, java.lang.String str)
level
- The level of this debug message.str
- The string to be printed.public static void dpnl(int level, java.lang.String str)
level
- The level of this debug message.str
- The string to be printed.public static void myassert(boolean assertion, java.lang.String str)
public static void myassert(boolean assertion, int l, java.lang.String str)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |