pub struct Logger { /* private fields */ }Expand description
Lightweight structured logging runtime with built-in query and follow support.
Implementations§
Source§impl Logger
impl Logger
Sourcepub fn builder(config: LoggerConfig) -> Result<LoggerBuilder, InitError>
pub fn builder(config: LoggerConfig) -> Result<LoggerBuilder, InitError>
Starts a construction-time builder for sink registration.
Sourcepub fn new(config: LoggerConfig) -> Result<Self, InitError>
pub fn new(config: LoggerConfig) -> Result<Self, InitError>
Creates a logger with the configured built-in sinks and runtime state.
Sourcepub fn emit(&self, event: LogEvent) -> Result<(), EventError>
pub fn emit(&self, event: LogEvent) -> Result<(), EventError>
Emits one structured log event through the configured sinks.
Sourcepub fn flush(&self) -> Result<(), FlushError>
pub fn flush(&self) -> Result<(), FlushError>
Flushes all registered sinks.
Sink flush failures are absorbed into logger health and counters so the caller can continue shutdown or health inspection without a secondary runtime failure.
§Panics
Panics if an internal sink-health mutex has been poisoned while one of the built-in sink implementations is updating its flush state.
Sourcepub fn query(&self, query: &LogQuery) -> Result<LogSnapshot, QueryError>
pub fn query(&self, query: &LogQuery) -> Result<LogSnapshot, QueryError>
Queries the current JSONL log set synchronously using the shared query contract.
§Panics
Panics if the internal query-health mutex has been poisoned while the runtime records the result of this query.
Sourcepub fn follow(&self, query: LogQuery) -> Result<LogFollowSession, QueryError>
pub fn follow(&self, query: LogQuery) -> Result<LogFollowSession, QueryError>
Starts a tail-style follow session from the current end of the visible log set.
§Panics
Panics if the internal query-health mutex has been poisoned while the runtime records the result of this follow-start operation.
Sourcepub fn shutdown(&self) -> Result<(), ShutdownError>
pub fn shutdown(&self) -> Result<(), ShutdownError>
Shuts the logger down and makes logger-owned query/follow unavailable.
§Panics
Panics if an internal sink-health mutex or the internal query-health mutex has been poisoned while shutdown is flushing sinks and marking query/follow unavailable.
Sourcepub fn health(&self) -> LoggingHealthReport
pub fn health(&self) -> LoggingHealthReport
Returns aggregate logging and query/follow health for the runtime.
§Panics
Panics if the internal last-error mutex has been poisoned.