The mi_tracelevel_set() function
The mi_tracelevel_set() function sets the trace level for specified trace classes.
Syntax
mi_integer mi_tracelevel_set(set_commands)
const mi_string *set_commands;
- set_commands
- A list of value pairs that specify trace class names and integer trace levels. A space separates each class-name and trace-level pair from the next pair.
Valid in client LIBMI application? | Valid in user-defined routine? |
---|---|
No | Yes |
Usage
The mi_tracelevel_set() function
sets the tracing levels for the trace classes that you specify in
the set_commands argument. This argument specifies trace classes
and their associated trace levels in the following format:
traceclass_name traceclass_level
The
following example sets the current trace level of trace class funcEntry to
50
and
the level for trace class outData to 35
:
mi_integer ret;
...
ret = mi_tracelevel_set("funcEntry 50 outData 35");
Important: A trace-class name must be defined in the systraceclasses system
catalog table before you run mi_tracelevel_set().
By default, tracing is off; that is, the current trace level is set to zero for all trace classes. Any nonzero value for a trace level turns tracing on for the specified trace class. A trace level can be any integer from zero to the maximum long integer value for the development platform.
If the trace level for the funcEntry trace
class was currently
50
, the following tracepoint
would execute because the value (10
) in the argument
to DPRINTF is not greater than the current level (50
)
of funcEntry:DPRINTF("funcEntry", 10,
("Entering compute_output with inStr = %s", inStr));
The trace message from this DPRINTF call would be written to the current trace-output file. For information about how to set the trace-output file, see the description of the mi_tracefile_set() function.
Return values
- MI_OK
- The function was successful.
- MI_ERROR
- The function was not successful.