Overview

All component messages destined for the caller (user) in BRAHMS should be passed to the local output object, bout, which is of type ComponentOut (undocumented) and has a similar interface to that of cout. These messages will be routed through the BRAHMS Structured Log facility, provided by the framework.

Notes
  • You can also send messages direct to stdout using cout, but it is not thread-safe to do so. In addition, the user will not be able to hide/show your messages. It's a fair technique to use during development if you want, though it's no more difficult to use bout.

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 always see this" << D_CRIT; bout << "but usually not this" << D_VERB; bout << "and this only when debugging" << D_1; // split messages bout << "parameter mismatch: "; if (A > B) { bout << "A > B"; } else { bout << "A <= B"; } bout << D_WARN;