WebSphere Message Brokers
File: as24510_
Writer: Lorraine Waitt

Reference topic

This build: July 31, 2007 21:38:35

cciUserDebugTrace

This function is very similar to cciUserTrace with the only difference being that the entry is written to user trace only when user trace is active at debug level.
Note: An entry is also written to service trace, when service trace is active at any level and when user trace is active at any level.

Syntax

void cciUserDebugTrace(
  int*           returnCode,
  CciObject*     object,
  const CciChar* messageSource,
  int            messageNumber,
  const char*    traceText,
  ...
);

Parameters

returnCode
Receives the return code from the function (output). A NULL pointer input signifies that the user-defined node does not wish to deal with errors. Any exceptions that are thrown during the execution of this call are re-thrown to the next upstream node in the flow. If the input is not NULL, the output signifies the success status of the call. If an exception occurs during execution, *returnCode is set to CCI_EXCEPTION on output. Call CciGetLastExceptionData for 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*, then the name of that node is written to trace. If it is a CciParser*, then 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.
If this parameter is NULL, the trace level for the execution group is returned.
messageSource
A string that identifies the Windows message source or the Linux and UNIX message catalog (input). When trace is formatted, a message from the NLS version of this catalog is written. The locale used is that of the environment where the trace is formatted. It is possible to run the broker on one type of platform, read the log on that platform, and then format the log on a different platform. For example, if the broker is running on Linux or UNIX but there is no .cat file available, the user could read the log, and then transfer it to Windows where the log can be formatted by using the .properties file.
If this parameter is NULL, the effect is the same as specifying an empty string. That is, all other information is written to the log, and the catalog field has an empty string value. If there is an empty string value, the log formatter can not find the message source. Therefore, the log formatter fails to format this entry.
messageNumber
The number that identifies the message within the specified messageSource (input). If the messageSource does not contain a message that corresponds to this messageNumber, the log formatter fails to format this entry.
traceText
A string of characters that ends with NULL (input). This string is written to service trace and provides an easy way to correlate trace entries with paths through the source code. For example, there could be several paths through the code that result in the same message (messageSource and messageNumber) being written to trace. traceText can be used to distinguish between these different paths. That is, the traceText string is a static literal string in the source and therefore the same string is in both the source code file and the formatted trace file.
...
A C variable argument list that contains any message inserts that accompany the message (input). These inserts are treated as character strings and the variable arguments are assumed to be of type pointer to char. The last argument in this list must be (char*)0.
  • For user-defined extensions that are running on distributed platforms, the char* arguments must be in ISO-8859-1 (ibm-918) codepage.
  • For user-defined extensions that are running on Z/OS platforms, the char* arguments must be in EBCIDIC (1047).
This includes all char* arguments in traceText and the variable argument list of inserts (...).

Return values

None. If an error occurs, the returnCode parameter indicates the reason for the error.

Example

const CciChar*   myMessageSource=CciString("SwitchMSG",BIP_DEF_COMP_CCSID);
CciNode*         thisNode = ((NODE_CONTEXT_ST*)context)->nodeObject;

const char* mbElementName  = mbString((CciChar*)&elementName,BIP_DEF_COMP_CCSID);
const char* mbElementValue = mbString((CciChar*)&elementValue,BIP_DEF_COMP_CCSID);
const char* traceTextFormat = "Switch Element: name=%s, value=%s";
char* traceText = (char*)malloc(strlen(traceTextFormat) + 
                                strlen(mbElementName) + 
                                strlen(mbElementValue));
sprintf(traceText,traceTextFormat,mbElementName,mbElementValue);
    
cciUserDebugTrace(&rc,
                 (CciObject*)thisNode,
                 myMessageSource,
                 2,
                 traceText,
                 mbElementName,
                 mbElementValue,
                 (char*)0);
free((void*)mbElementName);
free((void*)mbElementValue);
free((void*)traceText);
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:38:35

as24510_ This topic's URL is: