Package rasj.global
Class Debug
- java.lang.Object
-
- rasj.global.Debug
-
public class Debug extends java.lang.ObjectMethods of this static class perform debugging output into the servlet log (usually /opt/jakarta/logs/servlet.log). For entering a method to be traced, logging indent level is increased; the logging methods for leaving a method decrease indent, and the trace methods inbetween leave indentation unchanged. [Needless to say that both statically and dynamically the number of enters and leaves should match.]Four trace levels are provided, intended for reporting increasingly verbose (i.e., for decreasingly dangerous events):
- critical (always logged),
- warning (default level),
- sparse,
- verbose.
Initialisation requires passing the servlet object to gain an output stream to write to.
-
-
Field Summary
Fields Modifier and Type Field Description static intCRITICAL_LEVELlog only critical eventsstatic intDEFAULT_LEVELdebug threshold defaultstatic intSPARSE_LEVELlog also occasional output interesting for debuggingstatic intVERBOSE_LEVELlog all information available to aid debuggingstatic intWARNING_LEVELlog also warnings which do not really impede processing
-
Constructor Summary
Constructors Constructor Description Debug()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidenterCritical(java.lang.String what)method enter msg, output only with critical levelstatic voidenterSparse(java.lang.String what)method enter msg, output only with sparse levelstatic voidenterVerbose(java.lang.String what)method enter msg, output only with verbose log levelstatic voidenterWarning(java.lang.String what)method enter msg, output only with warning levelstatic voidleaveCritical(java.lang.String what)method leave msg, output only with critical levelstatic voidleaveSparse(java.lang.String what)method leave msg, output only with sparse levelstatic voidleaveVerbose(java.lang.String what)method leave msg, output only with verbose log levelstatic voidleaveWarning(java.lang.String what)method leave msg, output only with warning levelstatic voidsetDebugThreshold(int level)set debug threshold to control further outputstatic voidtalkCritical(java.lang.String what)method inside msg, output only with critical levelstatic voidtalkSparse(java.lang.String what)method inside msg, output only with sparse levelstatic voidtalkVerbose(java.lang.String what)method inside msg, output only with verbose log levelstatic voidtalkWarning(java.lang.String what)method inside msg, output only with warning level
-
-
-
Field Detail
-
CRITICAL_LEVEL
public static final int CRITICAL_LEVEL
log only critical events- See Also:
- Constant Field Values
-
WARNING_LEVEL
public static final int WARNING_LEVEL
log also warnings which do not really impede processing- See Also:
- Constant Field Values
-
SPARSE_LEVEL
public static final int SPARSE_LEVEL
log also occasional output interesting for debugging- See Also:
- Constant Field Values
-
VERBOSE_LEVEL
public static final int VERBOSE_LEVEL
log all information available to aid debugging- See Also:
- Constant Field Values
-
DEFAULT_LEVEL
public static final int DEFAULT_LEVEL
debug threshold default- See Also:
- Constant Field Values
-
-
Method Detail
-
setDebugThreshold
public static void setDebugThreshold(int level)
set debug threshold to control further output
-
enterCritical
public static void enterCritical(java.lang.String what)
method enter msg, output only with critical level
-
enterWarning
public static void enterWarning(java.lang.String what)
method enter msg, output only with warning level
-
enterSparse
public static void enterSparse(java.lang.String what)
method enter msg, output only with sparse level
-
enterVerbose
public static void enterVerbose(java.lang.String what)
method enter msg, output only with verbose log level
-
leaveCritical
public static void leaveCritical(java.lang.String what)
method leave msg, output only with critical level
-
leaveWarning
public static void leaveWarning(java.lang.String what)
method leave msg, output only with warning level
-
leaveSparse
public static void leaveSparse(java.lang.String what)
method leave msg, output only with sparse level
-
leaveVerbose
public static void leaveVerbose(java.lang.String what)
method leave msg, output only with verbose log level
-
talkCritical
public static void talkCritical(java.lang.String what)
method inside msg, output only with critical level
-
talkWarning
public static void talkWarning(java.lang.String what)
method inside msg, output only with warning level
-
talkSparse
public static void talkSparse(java.lang.String what)
method inside msg, output only with sparse level
-
talkVerbose
public static void talkVerbose(java.lang.String what)
method inside msg, output only with verbose log level
-
-