Package rasj.global

Class Debug

java.lang.Object
rasj.global.Debug

public class Debug extends Object
Methods 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.
For each combination of enter/inside/leave of a method and trace levels corresponding report functions are provided. Finally, the debug level can be changed any time with setDebugLevel().

Initialisation requires passing the servlet object to gain an output stream to write to.

  • Field Details

    • CRITICAL_LEVEL

      public static final int CRITICAL_LEVEL
      log only critical events
      See Also:
    • WARNING_LEVEL

      public static final int WARNING_LEVEL
      log also warnings which do not really impede processing
      See Also:
    • SPARSE_LEVEL

      public static final int SPARSE_LEVEL
      log also occasional output interesting for debugging
      See Also:
    • VERBOSE_LEVEL

      public static final int VERBOSE_LEVEL
      log all information available to aid debugging
      See Also:
    • DEFAULT_LEVEL

      public static final int DEFAULT_LEVEL
      debug threshold default
      See Also:
  • Constructor Details

    • Debug

      public Debug()
  • Method Details

    • setDebugThreshold

      public static void setDebugThreshold(int level)
      set debug threshold to control further output
    • enterCritical

      public static void enterCritical(String what)
      method enter msg, output only with critical level
    • enterWarning

      public static void enterWarning(String what)
      method enter msg, output only with warning level
    • enterSparse

      public static void enterSparse(String what)
      method enter msg, output only with sparse level
    • enterVerbose

      public static void enterVerbose(String what)
      method enter msg, output only with verbose log level
    • leaveCritical

      public static void leaveCritical(String what)
      method leave msg, output only with critical level
    • leaveWarning

      public static void leaveWarning(String what)
      method leave msg, output only with warning level
    • leaveSparse

      public static void leaveSparse(String what)
      method leave msg, output only with sparse level
    • leaveVerbose

      public static void leaveVerbose(String what)
      method leave msg, output only with verbose log level
    • talkCritical

      public static void talkCritical(String what)
      method inside msg, output only with critical level
    • talkWarning

      public static void talkWarning(String what)
      method inside msg, output only with warning level
    • talkSparse

      public static void talkSparse(String what)
      method inside msg, output only with sparse level
    • talkVerbose

      public static void talkVerbose(String what)
      method inside msg, output only with verbose log level