Overview

Component messages destined for the parallel-ready Structured Log should be passed to the local output object, bout, which is of type ComponentOut (undocumented) and has a similar interface to that of cout.

Notes
  • You can also send messages direct to stdout or stderr. However, it is not thread-safe to do so, the user cannot hide/show your messages, and it may not be clear where they came from. It's a fair technique to use during development, but it is recommended that you only generate messages through the Structured Log in production code.

Interface

C++ Source Code (against 1199)
bout << stuff << ... << DetailLevel;

Operation

The bout object will concatenate all messages and pass the result to the Structured Log with the specified detail level. stuff can be anything that you would normally pass to cout, for example string literals, STL strings, or numerics. Note that the output is not passed until you specify a detail level, so you can separate the call over multiple lines if required (see Example).

Example

C++ Source Code (against 1199)
// detail levels bout << "you'll see this by default" << D_WARN; bout << "and this" << D_INFO; bout << "but not this" << D_VERB; // split messages bout << "parameter mismatch: "; if (A > B) { bout << "A > B"; } else { bout << "A <= B"; } bout << D_WARN;