Debugging macro scripts with the <trace> element
When you are debugging, you can use the <trace>
element to send text and values to a trace output destination. In
particular, if you include the name of a variable in the output, then
the macro runtime will display both the name and the value of the
variable in the output, enclosed in curly braces {}. Here is an example:
Figure 1. Example
of using the <trace> element
The code shown in the figure above prints the following text
to the console:
<vars>
<create name="$var1$" type="string" value="'original'" />
</vars>
.
.
<actions>
<trace type="SYSOUT" value="'Before update: '+$var1$" />
<varupdate name="$var1$" value="'updated'" />
<trace type="SYSOUT" value="'After update: '+$var1$" />
</actions>
Figure 2. Output from example of using the <trace> element
Notice that the <trace> action displays each variable in
curly braces {} that contain both the variable name and the contents
of the variable.Before update: +{$var1$ = original}
After update: +{$var1$ = updated}