IDebug
© 1997-2001 Joseph Kiniry
© 2000-2001 KindSoftware
© 1997-1999 Caltech
All Rights Reserved

idebug
Interface DebugConstants

All Known Subinterfaces:
FrenchConstants
All Known Implementing Classes:
DefaultDebugConstants

public interface DebugConstants

DebugConstants is an interface that collects the various constants of the debugging package including debug level ranges, standard debugging messages, statistics definitions, etc.

This interface can be implemented or the default implementation of it can be subtyped to modify the various values contained herein for specific debugging subpackages, applications, etc.

An example of such a subtype is included as FrenchConstants.

The default categories are specified in the following table.
Category Level Description
ASSERTION 9 The highest level category that exists. Assertions are predicates that must be true. If an assertion is false, a stack dump takes place and the object in question should shut down in an orderly fashion. Note that a single assertion should be made for each predicate that is in the precondition, postcondition, requires, and ensures expressions for every method.
FAILURE 9 The highest level category that exists. Sometimes a object need fail outside an assertion. This default category provides this functionality. If a failure is seen, a stack dump takes place and the object in question should shut down in an orderly fashion.
CRITICAL 7 Very important problems/errors that will eventually cause Failures or Assertions should be tagged as Critical. The user/system must be information of such problems but the object in question need not shut down immediately and can potentially recover. Typical examples of Critial errors are resource-related errors (out of memory, disk space, cpu time, etc.).
ERROR 5 This is the standard error level. An Error means "something went wrong and the user should probably be notified whether the the system can automatically recover properly or not".
WARNING 3 A warning is a message that says something has gone wrong but it's not terribly serious. Warnings are often, but not always, communicated on to the user.
NOTICE 1 A notice is simply a progress message. Notices are used to track a thread of control during debugging.

Version:
$Revision: 2146 $ $Date: 2005-02-13 16:54:27 +0000 (Sun, 13 Feb 2005) $
Author:
Joseph R. Kiniry
See Also:
Debug, Context, Assert, DebugOutput, Collect, Statistic, DefaultDebugConstants, FrenchConstants

Field Summary
static java.lang.String ASSERTION
           The highest level category that exists.
static int ASSERTION_LEVEL
           The highest level category that exists.
static java.lang.String CRITICAL
           Very important problems/errors that will eventually cause Failures or Assertions should be tagged as Critical.
static int CRITICAL_LEVEL
           Very important problems/errors that will eventually cause Failures or Assertions should be tagged as Critical.
static java.lang.String ERROR
           This is the standard error level.
static int ERROR_LEVEL
           This is the standard error level.
static java.lang.String ERROR_STRING
           An error message that can be localized or otherwise customized.
static java.lang.String FAILED_ASSERTION_STRING
           An assertion failure message that can be localized or otherwise customized.
static java.lang.String FAILURE
           The highest level category that exists.
static int FAILURE_LEVEL
           The highest level category that exists.
static int INVALID_THREAD
           Indicates that an invalid thread was passed to a thread-related method in idebug.Debug.
static int LEVEL_MAX
           The maximum debug level.
static int LEVEL_MIN
           The minimum debug level.
static java.lang.String NOTICE
           A notice is simply a progress message.
static int NOTICE_LEVEL
           A notice is simply a progress message.
static java.lang.String WARNING
           A warning is a message that says something has gone wrong but it's not terribly serious.
static int WARNING_LEVEL
           A warning is a message that says something has gone wrong but it's not terribly serious.
 
Method Summary
 boolean checkLevel(int l)
           Check whether a level is valid, that is, bound byte the minimum and maximum levels of this interface's implementation.
 void initCategories(java.util.Hashtable hashtable)
           Initializes default categories of debugging facilities.
 

Field Detail

LEVEL_MIN

public static final int LEVEL_MIN

The minimum debug level.


LEVEL_MAX

public static final int LEVEL_MAX

The maximum debug level.


ERROR_STRING

public static final java.lang.String ERROR_STRING

An error message that can be localized or otherwise customized.


FAILED_ASSERTION_STRING

public static final java.lang.String FAILED_ASSERTION_STRING

An assertion failure message that can be localized or otherwise customized.


ASSERTION_LEVEL

public static final int ASSERTION_LEVEL

The highest level category that exists. Assertions are predicates that must be true. If an assertion is false, a stack dump takes place and the object in question should shut down in an orderly fashion. Note that a single assertion should be made for each predicate that is in the precondition, postcondition, requires, and ensures expressions for every method.


FAILURE_LEVEL

public static final int FAILURE_LEVEL

The highest level category that exists. Sometimes a object need fail outside an assertion. This default category provides this functionality. If a failure is seen, a stack dump takes place and the object in question should shut down in an orderly fashion.


CRITICAL_LEVEL

public static final int CRITICAL_LEVEL

Very important problems/errors that will eventually cause Failures or Assertions should be tagged as Critical. The user/system must be information of such problems but the object in question need not shut down immediately and can potentially recover. Typical examples of Critial errors are resource-related errors (out of memory, disk space, cpu time, etc.).


ERROR_LEVEL

public static final int ERROR_LEVEL

This is the standard error level. An Error means "something went wrong and the user should probably be notified whether the the system can automatically recover properly or not".


WARNING_LEVEL

public static final int WARNING_LEVEL

A warning is a message that says something has gone wrong but it's not terribly serious. Warnings are often, but not always, communicated on to the user.


NOTICE_LEVEL

public static final int NOTICE_LEVEL

A notice is simply a progress message. Notices are used to track a thread of control during debugging.


ASSERTION

public static final java.lang.String ASSERTION

The highest level category that exists. Assertions are predicates that must be true. If an assertion is false, a stack dump takes place and the object in question should shut down in an orderly fashion. Note that a single assertion should be made for each predicate that is in the precondition, postcondition, requires, and ensures expressions for every method.


FAILURE

public static final java.lang.String FAILURE

The highest level category that exists. Sometimes a object need fail outside an assertion. This default category provides this functionality. If a failure is seen, a stack dump takes place and the object in question should shut down in an orderly fashion.


CRITICAL

public static final java.lang.String CRITICAL

Very important problems/errors that will eventually cause Failures or Assertions should be tagged as Critical. The user/system must be information of such problems but the object in question need not shut down immediately and can potentially recover. Typical examples of Critial errors are resource-related errors (out of memory, disk space, cpu time, etc.).


ERROR

public static final java.lang.String ERROR

This is the standard error level. An Error means "something went wrong and the user should probably be notified whether the the system can automatically recover properly or not".


WARNING

public static final java.lang.String WARNING

A warning is a message that says something has gone wrong but it's not terribly serious. Warnings are often, but not always, communicated on to the user.


NOTICE

public static final java.lang.String NOTICE

A notice is simply a progress message. Notices are used to track a thread of control during debugging.


INVALID_THREAD

public static final int INVALID_THREAD

Indicates that an invalid thread was passed to a thread-related method in idebug.Debug.

Method Detail

initCategories

public void initCategories(java.util.Hashtable hashtable)

Initializes default categories of debugging facilities.

Parameters:
hashtable - is the hashtable to initialize.

checkLevel

public boolean checkLevel(int l)

Check whether a level is valid, that is, bound byte the minimum and maximum levels of this interface's implementation.

Parameters:
l - the level to check.
Returns:
a boolean indicating if the passed level is valid.

IDebug
© 1997-2001 Joseph Kiniry
© 2000-2001 KindSoftware
© 1997-1999 Caltech
All Rights Reserved