History logs and trace files allow you to log information about your programs.
The log functions allow you to write message text to the iSeries™ Access for Windows® History Log. The message text needs to be displayable ASCII character data.
iSeries Access for Windows has instrumented all of its programs to log messages to the iSeries Access for Windows History Log. Messages also are logged by the DLLs that are supplied with the product.
The History Log is a file where message text strings are logged through the cwbSV_LogMessageText API. The log provides a history of activity that has taken place on the client workstation.
The trace functions allow you to log low-level events that occur as your program runs. For example, you can track various return codes that were received from calling other functions. If your program is sending and receiving data, you may want to log the significant fields of the data (for example, function byte or bytes, and data length) to aid in debugging if something goes wrong. Use the Detailed data trace function (cwbSV_LogTraceData) to accomplish this.
Another form of trace, the Entry Point trace function, allows you to track entry into and exit from your routines. iSeries Access for Windows defines two different types of entry point trace points:
The key piece of information that is provided on the APIs is a one-byte eventID. It allows you to identify which API or SPI is being entered or exited. Data such as input values can be traced on entry, as well as tracing output values on exit from a routine. These trace functions are intended to be used in pairs (for example, cwbSV_LogAPIEntry and cwbSV_LogAPIExit) in the routines that utilize them. These types of trace points provide a record of flow of control through the code.
iSeries Access for Windows has instrumented the procedural APIs described in this topic with Entry/Exit API trace points. When one of these procedural APIs is called, entry and exit trace points are logged to the Entry Point trace file if tracing is active. The Entry/Exit SPI trace logs internal calling sequences. The Detailed data trace function logs data which is useful in debugging problems.
iSeries Access for Windows supports the following types of traces: