cciIsTraceActive
cciIsTraceActive reports whether trace is active and the level at which trace is active.
Syntax
CCI_TRACE_TYPE cciIsTraceActive(
int* returnCode,
CciObject* object);
Parameters
- returnCode
- Receives the return code from the function (output). A NULL pointer input signifies that the user-defined node does not want to deal with errors. Any exceptions thrown during the execution of this call will be re-thrown to the next upstream node in the flow. If input is not NULL, output will signify the success status of the call. If an exception occurs during execution, *returnCode will be set to CCI_EXCEPTION on output. A call to CciGetLastExceptionData will provide details of the exception.
- object
- The address of the object that is to be associated with the trace entry (input). This object can be a CciNode* or a CciParser*. If it is a CciNode*, the name of that node is written to trace. If it is a CciParser*, the name of the node that created the parser is written to trace. This object is also used to determine if the entry should be written to trace. The entry is only written if trace is active for the node. Currently nodes inherit their trace setting from the message flow.
Return values
A CCI_TRACE_TYPE value indicating the level of trace that
is currently active. The CCI_TRACE_TYPE type has the following possible
values:
- CCI_USER_NORMAL_TRACE
- CCI_USER_DEBUG_TRACE
- CCI_ SERVICE_NORMAL_TRACE
- CCI_SERVICE_DEBUG_TRACE
- CCI_TRACE_NONE
- CCI_USER_NORMAL_TRACE + CCI_ SERVICE_NORMAL_TRACE
- CCI_USER_NORMAL_TRACE + CCI_SERVICE_DEBUG_TRACE
- CCI_USER_DEBUG_TRACE + CCI_ SERVICE_NORMAL_TRACE
- CCI_USER_DEBUG_TRACE + CCI_SERVICE_DEBUG_TRACE
Two
further values can be used as bitmasks when querying the active level
of trace. These are:
- CCI_USER_TRACE
- CCI_SERVICE_TRACE
(traceLevel & CCI_USER_TRACE)
will
evaluate to a non zero value for traceLevel for
the following return values:- CCI_USER_NORMAL_TRACE + CCI_ SERVICE_NORMAL_TRACE
- CCI_USER_NORMAL_TRACE + CCI_SERVICE_DEBUG_TRACE
- CCI_USER_DEBUG_TRACE + CCI_ SERVICE_NORMAL_TRACE
- CCI_USER_DEBUG_TRACE + CCI_SERVICE_DEBUG_TRACE
- CCI_USER_NORMAL_TRACE
- CCI_USER_DEBUG_TRACE
(traceLevel & CCI_USER_TRACE)
will
evaluate to zero for traceLevel for the
following return values: - CCI_SERVICE_NORMAL_TRACE
- CCI_SERVICE_DEBUG_TRACE
- CCI_TRACE_NONE
Example
CciNode* thisNode = ((NODE_CONTEXT_ST*)context)->nodeObject;
const CCI_TRACE_TYPE traceActive = cciIsTraceActive(&rc, (CciObject*)thisNode);
checkRC(rc);