Skip to content

Commit 20e06e2

Browse files
committed
add C++ support for RecordingStream::stdout
1 parent 03596f5 commit 20e06e2

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

rerun_cpp/src/rerun/c/rerun.h

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rerun_cpp/src/rerun/recording_stream.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ namespace rerun {
128128
return status;
129129
}
130130

131+
Error RecordingStream::stdout() const {
132+
rr_error status = {};
133+
rr_recording_stream_stdout(_id, &status);
134+
return status;
135+
}
136+
131137
void RecordingStream::flush_blocking() const {
132138
rr_recording_stream_flush_blocking(_id);
133139
}

rerun_cpp/src/rerun/recording_stream.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,16 @@ namespace rerun {
174174
/// This function returns immediately.
175175
Error save(std::string_view path) const;
176176

177+
/// Stream all log-data to stdout.
178+
///
179+
/// Pipe the result into the Rerun Viewer to visualize it.
180+
///
181+
/// If there isn't any listener at the other end of the pipe, the `RecordingStream` will
182+
/// default back to `buffered` mode, in order not to break the user's terminal.
183+
///
184+
/// This function returns immediately.
185+
Error stdout() const;
186+
177187
/// Initiates a flush the batching pipeline and waits for it to propagate.
178188
///
179189
/// See `RecordingStream` docs for ordering semantics and multithreading guarantees.

0 commit comments

Comments
 (0)