trace()

Generates a trace message.

Syntax

void trace(String traceMsg)
 void trace(int traceLevel, String traceMsg)
 void trace(int traceLevel, int messageNum)
 void trace(int traceLevel, int messageNum, String param [,...])
 void trace(int traceLevel, int messageNum, Object[] paramArray)
 

Parameters

traceLevel
The tracing level that causes the message to be generated.

traceMsg
A string that prints to the trace file.

messageNum
A number that represents a message in the map message file.

param
A single parameter. You can add additional single parameters, separated by commas, up to a total of five.

paramArray
An array of parameters.

Notes

The trace() method generates a message that the map prints if tracing is turned on. This method has five forms:

Note:
All forms of the method that take a messageNum parameter require the use of a message file that is indexed by message number. For information on how to set up a message text file, refer to Appendix A, "Message files".

You can set the trace level for a map as part of the Map Properties.

Examples

The following example generates a Level 2 trace message and supplies the text of the message:

trace (2, "Starting to trace at Level 2");
 

The following example prints message 201 in the map message file if the trace level is 2 or higher. The message has two parameters, a name and a year, for which this method call passes values.

trace(2, 201, "DAVID", "1961");
 

See also

logError(), logInfo(), logWarning()

Copyright IBM Corp. 1997, 2003