File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -356,6 +356,9 @@ impl RecordingStreamBuilder {
356
356
357
357
/// Creates a new [`RecordingStream`] that is pre-configured to stream the data through to stdout.
358
358
///
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
+ ///
359
362
/// ## Example
360
363
///
361
364
/// ```no_run
@@ -1341,6 +1344,9 @@ impl RecordingStream {
1341
1344
1342
1345
/// Swaps the underlying sink for a [`crate::sink::FileSink`] pointed at stdout.
1343
1346
///
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
+ ///
1344
1350
/// This is a convenience wrapper for [`Self::set_sink`] that upholds the same guarantees in
1345
1351
/// terms of data durability and ordering.
1346
1352
/// See [`Self::set_sink`] for more information.
@@ -1352,6 +1358,7 @@ impl RecordingStream {
1352
1358
1353
1359
let is_stdout_listening = !atty:: is ( atty:: Stream :: Stdout ) ;
1354
1360
if !is_stdout_listening {
1361
+ self . set_sink ( Box :: new ( crate :: log_sink:: BufferedSink :: new ( ) ) ) ;
1355
1362
return Ok ( ( ) ) ;
1356
1363
}
1357
1364
You can’t perform that action at this time.
0 commit comments