Tracing enhancement: SET.LIT 1.2(162) now supports expanded DEBUG options in order to take advantage of the expanded trace statement options:
Option |
Description |
.SET DEBUG ? |
Show syntax options |
.SET DEBUG <level> |
Set debug level |
.SET DEBUG MIN <level> |
Set minimum debug level |
.SET DEBUG TAGS {+}tag1,...tagn |
Set tags to select/filter traces |
.SET DEBUG OUTPUT <dest> |
Specify where trace output goes |
The standard SET DEBUG <level> command is unchanged, except that the maximum has been increased from 9 to 2^31. Note that except for programs which explicitly map a variable named DEBUG, the runtime system will recognize DEBUG as a special system variable whose value is that specified by the SET DEBUG <level> command.
The DEBUG MIN option allows you set a minimum level, such that only those trace/debug statements specifying a level >= the DEBUG MIN level and <= the DEBUG level will be activated. The idea here is to allow different developers to set exclusive ranges so that they can easily enable their own debug traces independent of others'. Or to use different ranges for different modules (although the tags might be more suited for that).
The DEBUG TAGS option allows you to specify a list of tags (comma delimited) to be matched up with the tags in the actual trace/debug statements for the purposes of filtering which will be enabled. Tags are not case sensitive. If the list starts with "+", then individual traces will be enabled if they meet the debug level criteria OR they contain a matching tag. Otherwise statements to be enabled must match both criteria, i.e. satisfy the level AND match one of the tags. Note that setting the DEBUG TAGS list to "" is equivalent to a wildcard matching all tags. But within the trace/debug statements themselves, and empty tag list matches only an empty DEBUG TAGS list.
To select statements by level without regard to tags, set the DEBUG TAGS to "". To select statements by tags without regard to level, specify a DEBUG TAGS list starting with "+". (To exclude traces that don't contain matching tags, use the DEBUG and/or DEBUG MIN levels to make sure that they won't match up with any of your traces. For example, if all of your trace statements are of the form DEBUG.xxx, instead of TRACE.xxx, or all of them explicitly specify a non-zero level, then just use SET NODEBUG to make sure that none are selected on the basis of the debug level. Alternatively, set the DEBUG MIN level higher than the DEBUG level.)
Note that all TRACE.xxx and DEBUG.xxx statements automatically have a special tag associated with them that matches the current program name, so to select only traces for that program, use the technique just described with SET DEBUG TAGS +program.
The DEBUG OUTPUT option controls where the trace/debug output messages go. The options for <dest> are:
<dest> |
Message Destination |
$WIN |
debug message window; default for GUI environment |
$TTY |
main screen; default for text environment |
$LOG |
A-Shell main log file (ashlog.log) |
$NULL |
no output |
$SBX:sbxnam |
redirect to specified sbxnam.SBX |
<filespec> |
an output filespec to output to a file |