Skip to content

Commit

Permalink
mention the atty business
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Dec 13, 2023
1 parent 007be2f commit 68bdbca
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/re_sdk/src/recording_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1341,6 +1344,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.
Expand All @@ -1352,6 +1358,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(());
}

Expand Down

0 comments on commit 68bdbca

Please sign in to comment.