Package rasj.global

Class Debug


  • public class Debug
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      static int CRITICAL_LEVEL
      log only critical events
      static int DEFAULT_LEVEL
      debug threshold default
      static int SPARSE_LEVEL
      log also occasional output interesting for debugging
      static int VERBOSE_LEVEL
      log all information available to aid debugging
      static int WARNING_LEVEL
      log 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 void enterCritical​(java.lang.String what)
      method enter msg, output only with critical level
      static void enterSparse​(java.lang.String what)
      method enter msg, output only with sparse level
      static void enterVerbose​(java.lang.String what)
      method enter msg, output only with verbose log level
      static void enterWarning​(java.lang.String what)
      method enter msg, output only with warning level
      static void leaveCritical​(java.lang.String what)
      method leave msg, output only with critical level
      static void leaveSparse​(java.lang.String what)
      method leave msg, output only with sparse level
      static void leaveVerbose​(java.lang.String what)
      method leave msg, output only with verbose log level
      static void leaveWarning​(java.lang.String what)
      method leave msg, output only with warning level
      static void setDebugThreshold​(int level)
      set debug threshold to control further output
      static void talkCritical​(java.lang.String what)
      method inside msg, output only with critical level
      static void talkSparse​(java.lang.String what)
      method inside msg, output only with sparse level
      static void talkVerbose​(java.lang.String what)
      method inside msg, output only with verbose log level
      static void talkWarning​(java.lang.String what)
      method inside msg, output only with warning level
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • Debug

        public Debug()
    • 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