rerun-io / rerun

Visualize streams of multimodal data. Fast, easy to use, and simple to integrate. Built in Rust using egui.
https://rerun.io/
Apache License 2.0
6.23k stars 287 forks source link

Support multiple sinks at once (`tee` logging) #1998

Open teh-cmc opened 1 year ago

teh-cmc commented 1 year ago

Something along the lines of this pseudo code:

struct LogSinkBundle(Vec<Box<dyn LogSink>>)

impl LogSink for LogSinkBundle { ... }

also need to update CLI args helpers for both Rust and Python to support mixing --save with anything else.

emilk commented 8 months ago

It is very useful to be able to dynamically add and remove sinks at runtime.

For instance:

This mean we need an API along the following lines:

rerun = rr.new_recording(app_id=…, …)
rerun.add_sink(file_path="foo.rrd")
viewer_sink_id = rerun.add_sink(spawn=True)
…
rerun.remove_sink(viewer_sink_id)

When no sinks are attached, rerun.log(…) should be a no-op

emilk commented 7 months ago

An interesting case to consider is streaming to an .rrd and calling spawn. We could set up the native viewer to be able to stream-load an .rrd file that is being written to, requiring no extra WebSocket connection. That would also mean the rerun library without the WebSocket feature (and huge dependency tree) could still support spawn (see https://github.com/rerun-io/rerun/issues/4788)

vmayoral commented 2 months ago

Adding to the thread another potential use case of interest: https://github.com/rerun-io/rerun/issues/6685

In a nutshell: Periodic calls to rr.save() to generate smaller/manageable log files. This is particular relevant in robotic systems generating tons of data from depth sensors and multiple cameras.

vmayoral commented 3 weeks ago

Hello all, any updates on this topic? Rationale at https://github.com/rerun-io/rerun/issues/1998#issuecomment-1887409983 makes a lot of sense to me as well. Thanks!