pub trait LogSink: Send + Sync + 'static {
// Required methods
fn send(&self, msg: LogMsg);
fn flush_blocking(&self);
// Provided methods
fn send_all(&self, messages: Vec<LogMsg>) { ... }
fn drain_backlog(&self) -> Vec<LogMsg> { ... }
fn drop_if_disconnected(&self) { ... }
fn send_blueprint(
&self,
blueprint: Vec<LogMsg>,
activation_cmd: BlueprintActivationCommand
) { ... }
}
Expand description
Where the SDK sends its log messages.
Required Methods§
sourcefn flush_blocking(&self)
fn flush_blocking(&self)
Blocks until all pending data in the sink’s send buffers has been fully flushed.
See also LogSink::drop_if_disconnected
.
Provided Methods§
sourcefn drain_backlog(&self) -> Vec<LogMsg>
fn drain_backlog(&self) -> Vec<LogMsg>
Drain all buffered LogMsg
es and return them.
Only applies to sinks that maintain a backlog.
sourcefn drop_if_disconnected(&self)
fn drop_if_disconnected(&self)
Drops all pending data currently sitting in the sink’s send buffers if it is unable to
flush it for any reason (e.g. a broken TCP connection for a TcpSink
).
sourcefn send_blueprint(
&self,
blueprint: Vec<LogMsg>,
activation_cmd: BlueprintActivationCommand
)
fn send_blueprint( &self, blueprint: Vec<LogMsg>, activation_cmd: BlueprintActivationCommand )
Send a blueprint directly to the log-sink.
This mirrors the behavior of crate::RecordingStream::send_blueprint
.