From 6d8f7b08aa798b6bc9d45409dfe7a7301a9efb77 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Wed, 13 Dec 2023 15:58:24 +0100 Subject: [PATCH] mention the atty business --- crates/re_sdk/src/recording_stream.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/re_sdk/src/recording_stream.rs b/crates/re_sdk/src/recording_stream.rs index 869be500f1bd..1b8f3b00fb89 100644 --- a/crates/re_sdk/src/recording_stream.rs +++ b/crates/re_sdk/src/recording_stream.rs @@ -356,6 +356,9 @@ impl RecordingStreamBuilder { /// Creates a new [`RecordingStream`] that is pre-configured to stream the data through to stdout. /// + /// If there isn't any listener at the other end of the pipe, the [`RecordingStream`] will + /// default back to `buffered` mode, in order not to break the user's terminal. + /// /// ## Example /// /// ```no_run @@ -1354,6 +1357,9 @@ impl RecordingStream { /// Swaps the underlying sink for a [`crate::sink::FileSink`] pointed at stdout. /// + /// If there isn't any listener at the other end of the pipe, the [`RecordingStream`] will + /// default back to `buffered` mode, in order not to break the user's terminal. + /// /// This is a convenience wrapper for [`Self::set_sink`] that upholds the same guarantees in /// terms of data durability and ordering. /// See [`Self::set_sink`] for more information. @@ -1365,6 +1371,7 @@ impl RecordingStream { let is_stdout_listening = !atty::is(atty::Stream::Stdout); if !is_stdout_listening { + self.set_sink(Box::new(crate::log_sink::BufferedSink::new())); return Ok(()); }