cciLogW

cciLogW logs an error, warning, or informational event. The event is logged by the integration node interface and uses the specified arguments as log data.

Syntax

void cciLogW(
  int*              returnCode,
  CCI_LOG_TYPE      type,
  const char*       file,
  int               line,
  const char*       function,
  const CciChar*    messageSource,
  int               messageNumber,
  const CciChar*    traceText,
                    ...
);

Parameters

returnCode
The return code from the function (output). If the messageSource parameter is null, the returnCode is set to CCI_INV_DATA_POINTER.
type
The type of event, as defined by CCI_LOG_TYPE (input). Valid values are:
  • CCI_LOG_ERROR
  • CCI_LOG_WARNING
  • CCI_LOG_INFORMATION
file
The source file name where the function was invoked (input). The value is optional, but it is useful for debugging purposes.
line
The line number in the source file where the function was invoked (input). The value is optional, but it is useful for debugging purposes.
function
The function name that invoked the log function (input). The value is optional, but it is useful for debugging purposes.
messageSource
The fully-qualified location and name of the Windows message source or the Linux®, UNIX, or z/OS® message catalog.

To use the current integration node message catalog, specify BIPmsgs on all operating systems. Alternatively, you can create your own message catalog.

messageNumber
The message number identifying the event (input). If messageNumber is specified as zero, it is assumed that a message is not available. If messageNumber is non-zero, the specified message is written into the integration node event log with any inserts provided in the variable argument list (see example).
traceText
Trace information that is written into the integration node service trace log (input). The information is optional, but it is useful for debugging purposes.
...
A C variable argument list containing 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 CciChar.

The last argument in this list must be (CciChar*)0.

Return values

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

Example

void logSomethingWithBroker(CciChar* helpfulText, 
                            char* file,
                            int line,  
                            char* func 
                            ){
  int rc = CCI_SUCCESS;
  /* set up the message catalog name */
  const CciChar* catalog = CciString("BIPmsgs", BIP_DEF_COMP_CCSID);

  cciLogW(&rc,
          CCI_LOG_INFORMATION 
          file, line, func,
          catalog, BIP2111,
          helpfulText,
          helpfulText,
          (CciChar*)0 
          );     
  
  if(CCI_SUCCESS != rc){
    const CciChar* message = CciString("Failed to log message",
                                       BIP_DEF_COMP_CCSID);
    raiseExceptionWithBroker(message, 
                             __FILE__, 
                             __LINE__, 
                             "logSomethingWithBroker");
  }   
}