Install a tracing subscriber that logs to stdout and publishes events into this bus.
(&self, env_filter: EnvFilter)
| 47 | |
| 48 | /// Install a tracing subscriber that logs to stdout and publishes events into this bus. |
| 49 | pub fn install_subscriber(&self, env_filter: EnvFilter) { |
| 50 | let layer = SandboxLogLayer { |
| 51 | bus: self.clone(), |
| 52 | default_tail: Self::DEFAULT_TAIL, |
| 53 | }; |
| 54 | |
| 55 | tracing_subscriber::registry() |
| 56 | .with(env_filter) |
| 57 | .with(tracing_subscriber::fmt::layer()) |
| 58 | .with(layer) |
| 59 | .init(); |
| 60 | } |
| 61 | |
| 62 | fn sender_for(&self, sandbox_id: &str) -> broadcast::Sender<SandboxStreamEvent> { |
| 63 | let mut inner = self.inner.lock().expect("tracing bus lock poisoned"); |