| 1 | = !OutputHandler = |
| 2 | |
| 3 | == Description == |
| 4 | |
| 5 | The [wiki:OutputHandler] acts like std::{{{}}}ostream (by overloading the << operator for all standard types and manipulators) and redirects output to three different streams: The logfile, the executing console and the [wiki:Shell ingame-shell]. |
| 6 | |
| 7 | Every stream has it's own maximal debug-level. Output only gets passed to a stream, if the level of the output is <= the configured level of the stream. To set the level of the output, use '''setOutputLevel('''''level''''')'''. After that, every following output will have this level. |
| 8 | |
| 9 | Usually the [wiki:Debug COUT(level) macro] handles this. The [wiki:CoreSettings debug level config values] define the levels of each stream. Read the related wiki-pages for more information. OutputHandler receives the configured output levels as soon as [wiki:CoreSettings] gets created. The [wiki:OutputBuffer] of the Shell will be added as soon as the Shell gets created. OutputHandler uses a fallback OutputBuffer until then. |
| 10 | |
| 11 | |
| 12 | == Functions == |
| 13 | * '''setOutputLevel('''''level''''')''': Sets the level of the following output. |
| 14 | * '''operator<<('''''output''''')''': Redirects an output to every stream (if the output-level fulfills the requirements). |
| 15 | |
| 16 | == Illustration == |
| 17 | [[Image(OutputHandler.png)]] |
| 18 | |
| 19 | The illustration shows how output chunks of different levels are passed to !OutputHandler. There they are distributed to the three output devices and filtered by the configured maximal output levels. At the end, gray chunks are displayed in the device while red chunks are discarded. |