Class Debug


  • public class Debug
    extends java.lang.Object
    A utility class for debugging.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static long TYPE_ALL
      Defines a mask containing all of the possible types.
      static long TYPE_API
      Defines an application programming interface (API) trace point.
      static long TYPE_CALLBACK
      Defines a callback method trace point.
      static long TYPE_DEFAULT_MESSAGE
      Defines the default message types.
      static long TYPE_ENTRY
      Defines method entry trace points.
      static long TYPE_ENTRY_EXIT
      Deprecated.
      TYPE_ENTRY_EXIT has been split into TYPE_ENTRY and TYPE_EXIT.
      static long TYPE_ERR
      Defines an error message.
      static long TYPE_ERROR
      Defines an error message.
      static long TYPE_ERROR_EXC
      Defines an error or exception condition trace point.
      static long TYPE_EXIT
      Defines method exit trace points.
      static long TYPE_FATAL
      Defines a fatal message.
      static long TYPE_FINE
      Equivalent to Level.FINE
      static long TYPE_FINER
      Equivalent to Level.FINER
      static long TYPE_FINEST
      Equivalent to Level.FINEST
      static long TYPE_INFO
      Defines an informational message.
      static long TYPE_INFORMATION
      Defines an informational message.
      static long TYPE_LEVEL1
      Defines a "low-detail" trace point.
      static long TYPE_LEVEL2
      Defines a "medium-detail" trace point.
      static long TYPE_LEVEL3
      Defines a "high-detail" trace point.
      static long TYPE_MISC_DATA
      Defines a miscellaneous data trace point.
      static long TYPE_NONE  
      static long TYPE_OBJ_CREATE
      Defines an object creation (constructor) trace point.
      static long TYPE_OBJ_DELETE
      Defines an object deletion (destructor) trace point.
      static long TYPE_PERF
      Defines a performance-monitoring trace point.
      static long TYPE_PRIVATE
      Defines a private method trace point.
      static long TYPE_PUBLIC
      Defines a public method trace point.
      static long TYPE_STATIC
      Defines a static method trace point.
      static long TYPE_SVC
      Defines a service code trace point.
      static long TYPE_WARN
      Defines a warning message.
      static long TYPE_WARNING
      Defines a warning message.
    • Constructor Summary

      Constructors 
      Constructor Description
      Debug​(java.lang.String name, java.lang.String rbName)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void data​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, byte[] data)  
      void entry​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod)  
      void entry​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.Object parm1)  
      void entry​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.Object[] parms)  
      void entry​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.Object parm1, java.lang.Object parm2)  
      void exception​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.Throwable throwable)  
      void exit​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod)  
      void exit​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, boolean retValue)  
      void exit​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, byte retValue)  
      void exit​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, char retValue)  
      void exit​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, double retValue)  
      void exit​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, float retValue)  
      void exit​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, int retValue)  
      void exit​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, long retValue)  
      void exit​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, short retValue)  
      void exit​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.Object retValue)  
      static Debug getInstance​(java.lang.String option)
      Get a Debug object corresponding to whether or not the given option is set.
      static Debug getInstance​(java.lang.String option, java.lang.String prefix)
      Get a Debug object corresponding to whether or not the given option is set.
      static void Help()  
      static boolean isOn​(java.lang.String option)
      True if the system property "security.debug" contains the string "option".
      static java.util.logging.Level longToLevel​(long type)  
      static int safeLongToInt​(long l)  
      void stackTrace​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod)  
      void stackTrace​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.String text)  
      void text​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.String text)  
      void text​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.String text, java.lang.Object parm1)  
      void text​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.String text, java.lang.Object[] parms)  
      void text​(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.String text, java.lang.Object parm1, java.lang.Object parm2)  
      static java.lang.String toHexString​(java.math.BigInteger b)
      return a hexadecimal printed representation of the specified BigInteger object.
      static java.lang.String toString​(byte[] b)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • TYPE_ALL

        public static final long TYPE_ALL
        Defines a mask containing all of the possible types.
        See Also:
        Constant Field Values
      • TYPE_FINE

        public static final long TYPE_FINE
        Equivalent to Level.FINE
      • TYPE_FINER

        public static final long TYPE_FINER
        Equivalent to Level.FINER
      • TYPE_FINEST

        public static final long TYPE_FINEST
        Equivalent to Level.FINEST
      • TYPE_INFO

        public static final long TYPE_INFO
        Defines an informational message. Use this type to indicate conditions that are worth noting but that do not require a user to take any precautions or perform an action. Sparing use of this type is suggested. An informational message is less severe than a warning message. This value is the same as TYPE_INFORMATION.
        See Also:
        Constant Field Values
      • TYPE_INFORMATION

        public static final long TYPE_INFORMATION
        Defines an informational message. This value is the same as TYPE_INFO.
        See Also:
        Constant Field Values
      • TYPE_WARN

        public static final long TYPE_WARN
        Defines a warning message. Use this type to inform a user that an abnormal condition has been detected. The particular condition will dictate whether the user has to take any action. A warning message is less severe than an error message. This value is the same as TYPE_WARNING.
        See Also:
        Constant Field Values
      • TYPE_ERR

        public static final long TYPE_ERR
        Defines an error message. Use this type to inform the user of a serious failure in the execution of a program. An error message is less severe than a fatal message. This value is the same as TYPE_ERROR.

        Note: TYPE_ERR is included in the default mask of a Logger and should not be confused with TYPE_ERROR_EXC, which is intended to be used for trace records by Trace.

        See Also:
        Constant Field Values
      • TYPE_ERROR

        public static final long TYPE_ERROR
        Defines an error message. This value is the same as TYPE_ERR.

        Note: TYPE_ERR is included in the default mask of a Logger and should not be confused with TYPE_ERROR_EXC, which is intended to be used for trace records by Trace.

        See Also:
        Constant Field Values
      • TYPE_FATAL

        public static final long TYPE_FATAL
        Defines a fatal message. Use this type to report an error from which the program cannot recover. A fatal message is the most severe message.
        See Also:
        Constant Field Values
      • TYPE_DEFAULT_MESSAGE

        public static final long TYPE_DEFAULT_MESSAGE
        Defines the default message types. The value is (TYPE_INFO | TYPE_WARN | TYPE_ERR | TYPE_FATAL.
        See Also:
        Constant Field Values
      • TYPE_PUBLIC

        public static final long TYPE_PUBLIC
        Defines a public method trace point. This typically includes package and protected scope, as all of these methods may be used by other classes.
      • TYPE_API

        public static final long TYPE_API
        Defines an application programming interface (API) trace point.
        See Also:
        Constant Field Values
      • TYPE_CALLBACK

        public static final long TYPE_CALLBACK
        Defines a callback method trace point. Callbacks are typically used in listener classes, which have registered with another object to be notified when a specific record occurs.
        See Also:
        Constant Field Values
      • TYPE_ENTRY_EXIT

        @Deprecated
        public static final long TYPE_ENTRY_EXIT
        Deprecated.
        TYPE_ENTRY_EXIT has been split into TYPE_ENTRY and TYPE_EXIT.
        Defines method entry and exit trace points.
        See Also:
        Constant Field Values
      • TYPE_ENTRY

        public static final long TYPE_ENTRY
        Defines method entry trace points. An entry trace point should be added to every significant method to track movement through an application. Trivial methods, such as getters and setters, generally don't have entry or exit trace points because of the added overhead.
        See Also:
        Constant Field Values
      • TYPE_EXIT

        public static final long TYPE_EXIT
        Defines method exit trace points. An exit trace point should be added to every significant method to track movement through an application. Trivial methods, such as getters and setters, generally don't have entry or exit trace points because of the added overhead.
        See Also:
        Constant Field Values
      • TYPE_ERROR_EXC

        public static final long TYPE_ERROR_EXC
        Defines an error or exception condition trace point. This type can be used to trace any exceptional condition.

        Note: TYPE_ERROR_EXC is included in the default mask of a Trace and should not be confused with TYPE_ERROR, which is intended to be used for message records by Logger.

        See Also:
        Constant Field Values
      • TYPE_MISC_DATA

        public static final long TYPE_MISC_DATA
        Defines a miscellaneous data trace point. This type can be used to trace information not covered by any other trace type.
        See Also:
        Constant Field Values
      • TYPE_OBJ_CREATE

        public static final long TYPE_OBJ_CREATE
        Defines an object creation (constructor) trace point.
        See Also:
        Constant Field Values
      • TYPE_OBJ_DELETE

        public static final long TYPE_OBJ_DELETE
        Defines an object deletion (destructor) trace point. This type would generally be used in a finalize method.
        See Also:
        Constant Field Values
      • TYPE_PRIVATE

        public static final long TYPE_PRIVATE
        Defines a private method trace point. Private trace points would be defined in methods with private scope.
        See Also:
        Constant Field Values
      • TYPE_STATIC

        public static final long TYPE_STATIC
        Defines a static method trace point.
        See Also:
        Constant Field Values
      • TYPE_SVC

        public static final long TYPE_SVC
        Defines a service code trace point. Service code is generally "low-level" code which provides commonly used services to other classes.
        See Also:
        Constant Field Values
      • TYPE_PERF

        public static final long TYPE_PERF
        Defines a performance-monitoring trace point. This type can be used to measure the execution time of selected sections of an application.
        See Also:
        Constant Field Values
      • TYPE_LEVEL1

        public static final long TYPE_LEVEL1
        Defines a "low-detail" trace point. Some trace implementations prefer the notion of a "trace level," in which level 1 implies minimal detail, level 2 implies more detail and level 3 implies the most detail. In such a system, these three types would be used exclusively.
        See Also:
        Constant Field Values
      • TYPE_LEVEL2

        public static final long TYPE_LEVEL2
        Defines a "medium-detail" trace point. Some trace implementations prefer the notion of a "trace level," in which level 1 implies minimal detail, level 2 implies more detail and level 3 implies the most detail. In such a system, these three types would be used exclusively.
        See Also:
        Constant Field Values
      • TYPE_LEVEL3

        public static final long TYPE_LEVEL3
        Defines a "high-detail" trace point. Some trace implementations prefer the notion of a "trace level," in which level 1 implies minimal detail, level 2 implies more detail and level 3 implies the most detail. In such a system, these three types would be used exclusively.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Debug

        public Debug​(java.lang.String name,
                     java.lang.String rbName)
    • Method Detail

      • Help

        public static void Help()
      • getInstance

        public static Debug getInstance​(java.lang.String option)
        Get a Debug object corresponding to whether or not the given option is set. Set the prefix to be the same as option.
      • getInstance

        public static Debug getInstance​(java.lang.String option,
                                        java.lang.String prefix)
        Get a Debug object corresponding to whether or not the given option is set. Set the prefix to be prefix.
      • isOn

        public static boolean isOn​(java.lang.String option)
        True if the system property "security.debug" contains the string "option".
      • data

        public void data​(long type,
                         java.lang.Object loggingClass,
                         java.lang.String loggingMethod,
                         byte[] data)
      • entry

        public void entry​(long type,
                          java.lang.Object loggingClass,
                          java.lang.String loggingMethod)
      • entry

        public void entry​(long type,
                          java.lang.Object loggingClass,
                          java.lang.String loggingMethod,
                          java.lang.Object parm1)
      • entry

        public void entry​(long type,
                          java.lang.Object loggingClass,
                          java.lang.String loggingMethod,
                          java.lang.Object parm1,
                          java.lang.Object parm2)
      • entry

        public void entry​(long type,
                          java.lang.Object loggingClass,
                          java.lang.String loggingMethod,
                          java.lang.Object[] parms)
      • exception

        public void exception​(long type,
                              java.lang.Object loggingClass,
                              java.lang.String loggingMethod,
                              java.lang.Throwable throwable)
      • exit

        public void exit​(long type,
                         java.lang.Object loggingClass,
                         java.lang.String loggingMethod)
      • exit

        public void exit​(long type,
                         java.lang.Object loggingClass,
                         java.lang.String loggingMethod,
                         byte retValue)
      • exit

        public void exit​(long type,
                         java.lang.Object loggingClass,
                         java.lang.String loggingMethod,
                         short retValue)
      • exit

        public void exit​(long type,
                         java.lang.Object loggingClass,
                         java.lang.String loggingMethod,
                         int retValue)
      • exit

        public void exit​(long type,
                         java.lang.Object loggingClass,
                         java.lang.String loggingMethod,
                         long retValue)
      • exit

        public void exit​(long type,
                         java.lang.Object loggingClass,
                         java.lang.String loggingMethod,
                         float retValue)
      • exit

        public void exit​(long type,
                         java.lang.Object loggingClass,
                         java.lang.String loggingMethod,
                         double retValue)
      • exit

        public void exit​(long type,
                         java.lang.Object loggingClass,
                         java.lang.String loggingMethod,
                         char retValue)
      • exit

        public void exit​(long type,
                         java.lang.Object loggingClass,
                         java.lang.String loggingMethod,
                         boolean retValue)
      • exit

        public void exit​(long type,
                         java.lang.Object loggingClass,
                         java.lang.String loggingMethod,
                         java.lang.Object retValue)
      • stackTrace

        public void stackTrace​(long type,
                               java.lang.Object loggingClass,
                               java.lang.String loggingMethod)
      • stackTrace

        public void stackTrace​(long type,
                               java.lang.Object loggingClass,
                               java.lang.String loggingMethod,
                               java.lang.String text)
      • text

        public void text​(long type,
                         java.lang.Object loggingClass,
                         java.lang.String loggingMethod,
                         java.lang.String text)
      • text

        public void text​(long type,
                         java.lang.Object loggingClass,
                         java.lang.String loggingMethod,
                         java.lang.String text,
                         java.lang.Object parm1)
      • text

        public void text​(long type,
                         java.lang.Object loggingClass,
                         java.lang.String loggingMethod,
                         java.lang.String text,
                         java.lang.Object parm1,
                         java.lang.Object parm2)
      • text

        public void text​(long type,
                         java.lang.Object loggingClass,
                         java.lang.String loggingMethod,
                         java.lang.String text,
                         java.lang.Object[] parms)
      • toHexString

        public static java.lang.String toHexString​(java.math.BigInteger b)
        return a hexadecimal printed representation of the specified BigInteger object. the value is formatted to fit on lines of at least 75 characters, with embedded newlines. Words are separated for readability, with eight words (32 bytes) per line.
      • toString

        public static java.lang.String toString​(byte[] b)
      • longToLevel

        public static java.util.logging.Level longToLevel​(long type)
      • safeLongToInt

        public static int safeLongToInt​(long l)