|
IMSEVimse 1.0 Draft |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--se.kth.cid.util.Tracer
This class is used for debugging and for putting trace printouts in code that may be controlled at runtime.
The printouts are controlled by a global log level When a trace is given to this class, it checks whether the trace is this log level or higher, and then proceeds to print it. Otherwise the trace is simply ignored. Debug traces cannot be turned off, though.
Field Summary | |
static int |
ALL
Use to get all traces. |
static int |
BUG
Programming error of some kind, that is only caused by a bug in the program. |
static int |
DEBUG
Will always be reported. |
static int |
DETAIL
Details from the inner workings. |
static int |
ERROR
Serious error in the program, that may be difficult to recover from. |
static int |
MAJOR_EXT_EVENT
Larger, externally visible event. |
static int |
MAJOR_INT_EVENT
Larger, internally visible event (implementation dependent) |
static int |
MINOR_EXT_EVENT
Lesser, externally visible event (e.g. |
static int |
MINOR_INT_EVENT
Lesser, internally visible event (implementation dependent) |
static int |
NONE
Use this as log level to never get any traces (except DEBUGs) |
static String[] |
TRACESTR
Array of the strings that are used to report the above levels. |
static int |
WARNING
Less serious errors that will not cause immediate problems. |
Method Summary | |
static void |
bug(String trace)
Used when a bug has been discovered. |
static void |
debug(String trace)
Used to debug program action. |
static void |
error(String trace)
Used when a serious error has occured, from which recovery is not foreseen. |
static String |
getTraceStr(int nlogLevel)
Returns the trace string for the given log level, i.e. |
static int |
parseLogLevel(String level)
Returns the loglevel represented by the string. |
static void |
setLogLevel(int nlogLevel)
Used to change the log level. |
static void |
trace(String trace,
int thisLogLevel)
Used to trace program action. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEBUG
public static final int BUG
public static final int ERROR
public static final int WARNING
public static final int MAJOR_EXT_EVENT
public static final int MINOR_EXT_EVENT
public static final int MAJOR_INT_EVENT
public static final int MINOR_INT_EVENT
public static final int DETAIL
public static final int NONE
public static final int ALL
public static final String[] TRACESTR
Method Detail |
public static int parseLogLevel(String level)
nLogLevelStr
- a string representing a loglevel.IllegalArgumentException
- if the loglevel is invalid.public static void setLogLevel(int nlogLevel)
nlogLevel
- the new log level. Must be positive or zero.public static String getTraceStr(int nlogLevel)
nlogLevel
- the log level to convert to a String.public static void trace(String trace, int thisLogLevel)
trace
- the string to display.thisLogLevel
- the loglevel of this trace.public static void error(String trace) throws Error
trace
- the string to display.Error
- always thrown.public static void bug(String trace) throws Error
trace
- the string to display.Error
- always thrown.public static void debug(String trace)
Tracer.trace(trace, Tracer.DEBUG)
trace
- the string to display.
|
IMSEVimse 1.0 Draft |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |