pub struct DispatchBuilder<const APPEND: bool> { /* private fields */ }
Expand description
A builder for configuring a log dispatch, including filters and appenders.
§Examples
use logforth_core::append;
use logforth_core::record::LevelFilter;
logforth_core::builder()
.dispatch(|d| {
d.filter(LevelFilter::Info)
.append(append::Stdout::default())
})
.apply();
Implementations§
Source§impl DispatchBuilder<false>
impl DispatchBuilder<false>
Sourcepub fn filter(self, filter: impl Into<Box<dyn Filter>>) -> Self
pub fn filter(self, filter: impl Into<Box<dyn Filter>>) -> Self
Add a filter to this dispatch.
§Examples
use logforth_core::append;
use logforth_core::record::LevelFilter;
logforth_core::builder()
.dispatch(|d| {
d.filter(LevelFilter::Error)
.append(append::Stderr::default())
})
.apply();
Sourcepub fn diagnostic(self, diagnostic: impl Into<Box<dyn Diagnostic>>) -> Self
pub fn diagnostic(self, diagnostic: impl Into<Box<dyn Diagnostic>>) -> Self
Add a diagnostic to this dispatch.
§Examples
use logforth_core::append;
use logforth_core::diagnostic;
use logforth_core::record::LevelFilter;
logforth_core::builder()
.dispatch(|d| {
d.filter(LevelFilter::Error)
.diagnostic(diagnostic::ThreadLocalDiagnostic::default())
.append(append::Stderr::default())
})
.apply();
Trait Implementations§
Auto Trait Implementations§
impl<const APPEND: bool> Freeze for DispatchBuilder<APPEND>
impl<const APPEND: bool> !RefUnwindSafe for DispatchBuilder<APPEND>
impl<const APPEND: bool> Send for DispatchBuilder<APPEND>
impl<const APPEND: bool> Sync for DispatchBuilder<APPEND>
impl<const APPEND: bool> Unpin for DispatchBuilder<APPEND>
impl<const APPEND: bool> !UnwindSafe for DispatchBuilder<APPEND>
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