|
Android-cuttlefish cvd tool
|
#include <display.h>
Public Member Functions | |
| LogMonitorDisplay (size_t width) | |
| void | DrawReport (MonitorSource *, size_t lines) |
| void | DrawReport (MonitorOutput, size_t lines) |
| LogMonitorDisplayResult | Finalize () |
Private Member Functions | |
| void | DrawBorderedText (const MonitorOutput &) |
| void | FormatAndDrawLine (std::string_view formatted) |
Private Attributes | |
| size_t | width_ |
| std::stringstream | ss_ |
| int | total_lines_drawn_ |
| bool | colorize_ |
LogMonitorDisplay formats and accumulates multiple log streams into a structured, bordered terminal display. It supports drawing boxes around log content, truncating long lines while preserving ANSI colors, and optionally stripping colors if the output terminal doesn't support them.
Example usage:
| cuttlefish::LogMonitorDisplay::LogMonitorDisplay | ( | size_t | width | ) |
Initializes the display with a fixed character width.
|
private |
Helper to draw a list of text lines inside a bordered box with a title.
| void cuttlefish::LogMonitorDisplay::DrawReport | ( | MonitorOutput | output, |
| size_t | lines | ||
| ) |
| void cuttlefish::LogMonitorDisplay::DrawReport | ( | MonitorSource * | source, |
| size_t | lines | ||
| ) |
| LogMonitorDisplayResult cuttlefish::LogMonitorDisplay::Finalize | ( | ) |
Appends the final bottom border to the display and returns the complete accumulated string and total line count.
|
private |
Formats a single line of text: parses it for specific log types (like logcat, kernel), applies color formatting, truncates to fit the display width, pads with spaces, and adds borders.
|
private |
|
private |
|
private |
|
private |