Using trace() to debug
trace() function introduced in Iguana 5.6 is our recommended method of viewing variables values for debugging. We also mention three previous (historical) methods and explain why using the built-in
trace() function is better.
First a basic example:
As you can see trace() is very simple, it just displays its parameters in the annotation block.
Examples of using trace()
- Tracing an HL7 message
- Tracing multiple variables
- Getting the most out of annotations and tracepoints
History: older methods that are no longer recommended
In the past we used three different functions for debugging. Initially we used the built-in
print() function and then a
debug() method that was very similar to
trace(). Then we introduced
trace(), which is now a built-in function.