traceWrite()

Writes a trace message to the log destination. This is a utility method for connector developers to use.

Syntax

void traceWrite(int traceLevel, char * info,
       char * filterName);
 

Parameters

traceLevel [in]
is one of the following trace-level constants to identify the trace level used to determine which trace messages are output:
Tracing::LEVEL1
 
  
 Tracing::LEVEL2
 
  
 Tracing::LEVEL3
 
  
 Tracing::LEVEL4
 
  
 Tracing::LEVEL5
 
 

The method writes the trace message when the current trace level is greater than or equal to traceLevel.

Note:
Do not specify a trace level of zero (LEVEL0) with a tracing message. A trace level of zero indicates that tracing is turned off. Therefore, any trace message associated with a traceLevel of LEVEL0 will never print.

info [in]
is a pointer to the message text to use for the trace message.

filterName [in]
is a pointer to a filter to use for writing the message. Specify NULL for this parameter.

Return values

None.

Notes

You can use the traceWrite() method to write your own trace messages for a connector. Tracing is turned on for the connector when the TraceLevel connector configuration property is set to a nonzero value (any trace-level constant except LEVEL0).

The traceWrite() method sends the specified msg text to the trace destination when the current trace level is greater than or equal to level. You establish the name of a connector's trace destination through the TraceFileName connector configuration property.

Because trace messages are usually needed only during debugging, whether trace messages are contained in a message file is left at the discretion of the developer:

Connector messages logged with traceWrite() are not viewable using LogViewer.

Examples

traceWrite(Tracing::LEVEL3, "Invalid LoginId", NULL);
 

See also

generateAndTraceMsg(), generateMsg()

See also the description of the Tracing class.

Copyright IBM Corp. 1997, 2003