Skip to main content

Logger

Struct Logger 

Source
pub struct Logger { /* private fields */ }
Expand description

Lightweight structured logging runtime with built-in query and follow support.

Implementations§

Source§

impl Logger

Source

pub fn builder(config: LoggerConfig) -> Result<LoggerBuilder, InitError>

Starts a construction-time builder for sink registration.

Source

pub fn new(config: LoggerConfig) -> Result<Self, InitError>

Creates a logger with the configured built-in sinks and runtime state.

Source

pub fn emit(&self, event: LogEvent) -> Result<(), EventError>

Emits one structured log event through the configured sinks.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Auto Trait Implementations§

§

impl !Freeze for Logger

§

impl !RefUnwindSafe for Logger

§

impl Send for Logger

§

impl Sync for Logger

§

impl Unpin for Logger

§

impl UnsafeUnpin for Logger

§

impl !UnwindSafe for Logger

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Observable for T
where T: Send + Sync + 'static,