[help] Suppressing `println` from other code
Hi - TUI newbie here :-).
I poll my log server for new log messages and unfortunately the client emits printlns which get rendered on top of the TUI. I know it's possible to gag stdout but that seems a very silly thing to do in a TUI!
Is there an idiomatic way of creating a new stdout and piping the println to that?
To be clear, this isn't a separate process, it is:
loop {
do_tui_rendering_stuff()?;
refresh_logs();
}
and refresh_logs has printlns.
Other than "well obviously don't use printlns!", what options do I have?
Thanks!
that's actually more a thing to configure in the backend of your choice. e.g the crossterm example for using stderr is here: https://github.com/crossterm-rs/crossterm/blob/master/examples/stderr.rs
but that only fixes the println obviously. stuff printed to stderr will still be appearing in your tui