IBM Streams 4.3.0

The SPLAPPTRC macro

You use the SPLAPPTRC macro to create trace entries in the processing element (PE) trace files.

An SPL operator runs in the context of a PE, and each PE has two sets of trace files (trace files and stdout/stderr files, which includes Processing Element Container (PEC) stdout/stderr files) and one set of log files (including PEC component log files). These files are accessed with the IBM® Streams administration tools. For example, to include debugging trace messages in the trace files, use this SPL code:
//        =level=  =message=       =debug aspects=
SPLAPPTRC(L_DEBUG, "Trace Message", "aspect1,aspect2");

The valid identifiers for the level of the SPLAPPTRC macro are L_ERROR(default), L_WARN, L_INFO, L_DEBUG, and L_TRACE. These identifiers correspond to the tracing configuration values.

The trace message can involve any expression that can be printed to a std::stringstream object by using the << operator. As an example, consider the following SPL code:
SPLAPPTRC(L_DEBUG, "The value for x is '" << x << "'", "MY_ASPECT");

Debug aspects for both macros are specified as comma-separated list of strings, which are used to filter out the log or trace messages. SPL automatically adds a prefix to the name of the current operator as a debug aspect.

Note: The SPLLOG macro is deprecated, and is replaced with the SPLAPPTRC macro. SPLLOG is mapped to SPLAPPTRC for compatibility with earlier versions.