Publish a log line from an external source (e.g., sandbox push). Injects the line into the same broadcast channel and tail buffer used by the tracing layer, so it appears in `WatchSandbox` and `GetSandboxLogs` transparently.
(&self, log: SandboxLogLine)
| 103 | /// used by the tracing layer, so it appears in `WatchSandbox` and |
| 104 | /// `GetSandboxLogs` transparently. |
| 105 | pub fn publish_external(&self, log: SandboxLogLine) { |
| 106 | let evt = SandboxStreamEvent { |
| 107 | payload: Some(openshell_core::proto::sandbox_stream_event::Payload::Log( |
| 108 | log.clone(), |
| 109 | )), |
| 110 | }; |
| 111 | self.publish(&log.sandbox_id, evt, Self::DEFAULT_TAIL); |
| 112 | } |
| 113 | |
| 114 | /// Default tail buffer capacity (lines per sandbox). |
| 115 | const DEFAULT_TAIL: usize = 2000; |