Debugging

The following macros are used to conditionally generate output for debugging. All output generated by these macros is written using the replaceable character-output procedure pointed to by the global variable SOMOutCharRoutine. The default procedure simply writes the character to stdout, but it can be replaced to change the output destination of the methods and functions below. (See Chapter 5 for more information on customizing SOM.)

Debugging output is produced or suppressed based on the settings of three global variables, SOM_TraceLevel, SOM_WarnLevel, and SOM_AssertLevel:

Available macros for generating debugging output are as follows:

<className>MethodDebug

SOM_TestC SOM_WarnMsg SOM_Assert SOM_Expect

See the System Object Model Programming Reference for more information on a specific macro.

The somDumpSelf and somPrintSelf methods can be useful in testing and debugging. The somPrintSelf method produces a brief description of an object, and the somDumpSelf method produces a more detailed description. See the System Object Model Programming Reference for more information.


[Back: Functions]
[Next: Checking the validity of method calls]