trace_write—write a text message to a trace module
trace_write arguments
Argument | Mode | Type | Description |
---|---|---|---|
$MODID | Input | STRING | Specifies the module identifier |
$LEVEL | Input | STRING | Specifies the message level:
|
The level can be indicated with the full name of the level or with only the first letter.
$TEXT | Input | STRING | Specifies the message text that you want to write to the trace |
Use the trace_write to write the textual message $TEXT in the trace module specified by identifier $MODID at level $LEVEL.
trace_write example - Registration of user trace module and writing a message on trace
DEFINES {
modid : INTEGER;
}
END
new test_trace_register : MC_CELL_START
triggers
{
$TRACE.modid = trace_register(USER01);
}
END
new test_trace_write : EVENT($E) where [$E.mc_tool==trace]
triggers
{
trace_write($TRACE.modid,INFORM,sprintf('Event #%u: %s',[$E.event_handle,$E.mc_tool_id]));
}
END
To register a user defined module, record TRACE is defined to store the module identifier in the modid slot, and a rule is triggered on the MC_CELL_START event to register the module when the cell starts.
Incoming events with mc_tool set to trace will write a text message in the trace that includes the event_handle and mc_tool_id slots of the event.
An event such as the following,
causes a message to be included in the trace in module USER01, as shown: