Skip to content

Commit 52d7156

Browse files
committed
mention the atty business
1 parent 2457cfb commit 52d7156

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/re_sdk/src/recording_stream.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,9 @@ impl RecordingStreamBuilder {
356356

357357
/// Creates a new [`RecordingStream`] that is pre-configured to stream the data through to stdout.
358358
///
359+
/// If there isn't any listener at the other end of the pipe, the [`RecordingStream`] will
360+
/// default back to `buffered` mode, in order not to break the user's terminal.
361+
///
359362
/// ## Example
360363
///
361364
/// ```no_run
@@ -1341,6 +1344,9 @@ impl RecordingStream {
13411344

13421345
/// Swaps the underlying sink for a [`crate::sink::FileSink`] pointed at stdout.
13431346
///
1347+
/// If there isn't any listener at the other end of the pipe, the [`RecordingStream`] will
1348+
/// default back to `buffered` mode, in order not to break the user's terminal.
1349+
///
13441350
/// This is a convenience wrapper for [`Self::set_sink`] that upholds the same guarantees in
13451351
/// terms of data durability and ordering.
13461352
/// See [`Self::set_sink`] for more information.
@@ -1352,6 +1358,7 @@ impl RecordingStream {
13521358

13531359
let is_stdout_listening = !atty::is(atty::Stream::Stdout);
13541360
if !is_stdout_listening {
1361+
self.set_sink(Box::new(crate::log_sink::BufferedSink::new()));
13551362
return Ok(());
13561363
}
13571364

0 commit comments

Comments
 (0)