ocean.io.console.AppStatus

Module to display application information in the terminal. Does not keep track of any values, only puts the information to the terminal in two separate portions - a static portion in the bottom and a streaming portion on top.

Generally, the static portion contains only a few lines used to display the progress/health of the application while the larger streaming portion is used to output logs or other application output. However, this is not a rule and applications are free to display whatever is needed in the static and streaming portions.

Since almost all applications that use this module also use Tango's logging facility, a separate appender (ocean.util.log.InsertConsole) has been developed to allow for application logs to be correctly displayed in the streaming portion. The InsertConsole appender moves the cursor just above the static lines, creates space by scrolling-up previously displayed content in the streaming portion, and then "inserts" the given log message in the newly created space. The existing static lines are not touched during this process.

The AppStatus + InsertConsole combination provides a convenient way to track the status of a long running command-line application in a friendly manner. However, there are few things that should be noted when using this module:

1. Once content in the streaming portion scrolls past the top of the terminal, it cannot be retrieved by scrolling up using a mouse or the scrollbar. 2. When redirecting to a file from the command-line using ">", only the contents of the streaming portion will be sent to the file, and not the contents of the static portion. 3. Content sent to the top streaming portion should not have tab characters or embedded newline characters. These would cause the streaming portion to spill over into the static portion, thus messing up the display. 4. Regular Stdout/Stderr calls should not be used as this would also cause the streaming portion to spill over into the static portion.

Members

Classes

AppStatus
class AppStatus

Ditto

Meta

License

Boost Software License Version 1.0. See LICENSE_BOOST.txt for details. Alternatively, this file may be distributed under the terms of the Tango 3-Clause BSD License (see LICENSE_BSD.txt for details).