gglib_core/ports/
server_log_sink.rs

1//! Server log sink port for structured log capture.
2//!
3//! This port abstracts the destination for server logs (stdout/stderr),
4//! allowing different implementations for CLI (noop), Tauri (structured storage),
5//! and Axum (SSE streaming).
6
7/// Port for appending server log lines to a sink.
8///
9/// Implementations should be thread-safe and non-blocking where possible.
10pub trait ServerLogSinkPort: Send + Sync {
11    /// Append a log line from a server process.
12    ///
13    /// # Arguments
14    ///
15    /// * `port` - Port the server is listening on (used for grouping logs)
16    /// * `stream_type` - Either "stdout" or "stderr"
17    /// * `line` - The log line content (without trailing newline)
18    fn append(&self, port: u16, stream_type: &str, line: String);
19}