Expand description
Log sink for in-process output routing.
The LogSink struct implements std::io::Write and forwards output to
TerminalWriter::write_log, ensuring that:
- Output is line-buffered (to prevent torn lines).
- Content is sanitized (escape sequences stripped) by default.
- The One-Writer Rule is respected.
§Usage
ⓘ
use ftui_runtime::log_sink::LogSink;
use std::io::Write;
// Assuming you have a mutable reference to TerminalWriter
let mut sink = LogSink::new(&mut terminal_writer);
// Now you can use it with any std::io::Write consumer
writeln!(sink, "This log message is safe: \x1b[31mcolors stripped\x1b[0m").unwrap();Structs§
- LogSink
- A write adapter that routes output to the terminal’s log scrollback.