pub struct LoggerFactory {}Expand description
The primary entry point for the Timber logging system.
LoggerFactory provides a centralized interface for creating specialized
loggers. It uses a fluent builder pattern to allow for granular configuration
of retry policies, concurrency models, and destination-specific settings.
§Example: Console Logging
let logger = LoggerFactory::cout()
.max_retries(5)
.build(Concurrency::Async);§Example: Capturing Logs for Testing
let logger = LoggerFactory::vector()
.capacity(500)
.build(Concurrency::Sync);Implementations§
Source§impl LoggerFactory
impl LoggerFactory
Sourcepub fn silent() -> Logger
pub fn silent() -> Logger
Returns a “No-Op” logger that discards all messages.
Useful for silencing output in production environments or as a default placeholder in library configuration.
Sourcepub fn loki() -> Loki
pub fn loki() -> Loki
Creates a builder for Grafana Loki.
Requires the loki feature to be enabled.
Sourcepub fn cloudwatch() -> CloudWatch
pub fn cloudwatch() -> CloudWatch
Creates a builder for Amazon CloudWatch.
Requires the aws feature to be enabled.
Sourcepub fn io() -> IoWrite
pub fn io() -> IoWrite
Creates a builder for byte-oriented output targets (Files, TCP streams).
Sourcepub fn fmt() -> FmtWrite
pub fn fmt() -> FmtWrite
Creates a builder for string-oriented output targets (String, in-memory buffers).
Auto Trait Implementations§
impl Freeze for LoggerFactory
impl RefUnwindSafe for LoggerFactory
impl Send for LoggerFactory
impl Sync for LoggerFactory
impl Unpin for LoggerFactory
impl UnwindSafe for LoggerFactory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.