version 2/100212 by Erik Temple
Section: Additional Rules Tracing Functionality
Inform's built-in debugging commands "rules on/all/off", "actions", and "scenes" are quite useful, but since they must be entered at the command prompt, they cannot be used to trace events that fire before the first command prompt appears. Especially in multimedia games, where we may want to track the setup of windows or other elements, this can be inconvenient.
Extended Debugging provides a number of phrases that can be used to issue the debug tracing commands from our source code rather than from the command prompt:
Turn on actions-tracing
Turn off actions-tracing
Turn on brief rule-tracing
Turn on intensive rule-tracing
Turn off rule-tracing
Turn on scenes-tracing
Turn off scenes-tracing
Brief rule-tracing corresponds to the command "rules on" and prints only the rules that apply. Intensive rule tracing refers to "rules all" and prints all rules considered, whether they were followed or not. It is probably best to use these phrases within a section that can be marked as "for use with Extended Debugging" so that they are easily turned off; that is, so that we need not manually delete them from the source once we wish to release a build without them.
We can also suspend and then reinstate rules-tracing (code via Ron Newcomb):
When we suspend rule-tracing, the game saves the level of rule-tracing we were at (brief or intensive) and restores that when we use the reinstate rule-tracing command. Otherwise, the options are not distinct from the options to turn rules-tracing on and off.