Including Variables in Trace Messages
The Execution Tracing package provides a helper macro to allow the use of streaming syntax in trace messages. The RW_STREAM_TO_STRING(stream) macro allows the concatenation of strings and variables, much like the insertion operator for an ostream works. Here’s an example:
 
RW_STREAM_TO_STRING( "The number of cups is ” << numCups << ".” );
 
Assuming numCups is in scope and has the value 5, the macro expands to the string “The number of cups is 5.” This macro is normally used as the parameter to the event generation macros:
 
RW_USER_TRACE_INFO( RW_STREAM_TO_STRING( "The number of cups is”
<< numCups << ".” ) );