SYNOPSIS
DESCRIPTION
The trace() command converts msg into human readable text useful for debugging. It makes use of the various lookup tables like mtd16.lutTag and others to generate useful output. Tag names are prefixed with an indicator of their type.
Calling a message in string context will automatically call the trace() function.
Lookup tables
For each tag inside the message the trace function does a reverse lookup into mtd16.lutTag. If successful, the name is decorated with the data type of the contents and printed. If unsuccessful, the tag is printed hexadecimal, prefixed with 0x.
If the first lookup provided a name and a lookup table mtd16.lutName exists, the value of the field is looked up reverse in that table. When successful, the printed value is replaced by the value found in the lookup table.
Filtering
If a table named mtd16.filterTrace exists, each tag is looked for in that table. If a function is found, it is called as f(messageCode, tag, value, subMessageCode).
Here messageCode is the tag of the containing message, tag is the tag of the item being filtered and data is the contents of the item. Finally, if the item is nested, then subMessageCode contains the tag of the nested message. Without nesting it is the same as messageCode.
When the function returns non-nil, the function result is printed instead of the actual value. This is useful if sensitive data must be hidden from debug, e.g. passwords and keys.
RETURN VALUE
NOTES
EXAMPLE
Note how 1 is replaced by busy due to mtd16.lutFnord.