Struct sentry_slog::SentryDrain
source · [−]pub struct SentryDrain<D: Drain> { /* private fields */ }Expand description
A Drain which passes all Records to Sentry.
Implementations
Sets a custom filter function.
The filter classifies how sentry should handle Records based on
their slog::Level.
pub fn mapper<M>(self, mapper: M) -> Self where
M: Fn(&Record<'_>, &OwnedKVList) -> RecordMapping + Send + Sync + 'static,
pub fn mapper<M>(self, mapper: M) -> Self where
M: Fn(&Record<'_>, &OwnedKVList) -> RecordMapping + Send + Sync + 'static,
Sets a custom mapper function.
The mapper is responsible for creating either breadcrumbs or events
from Records.
Examples
use sentry_slog::{breadcrumb_from_record, RecordMapping, SentryDrain};
let drain = SentryDrain::new(slog::Discard).mapper(|record, kv| match record.level() {
slog::Level::Trace => RecordMapping::Ignore,
_ => RecordMapping::Breadcrumb(breadcrumb_from_record(record, kv)),
});Trait Implementations
Handle one logging statement (Record) Read more
Avoid: Check if messages at the specified log level are maybe enabled for this logger. Read more
Avoid: See is_enabled
Avoid: See is_enabled
Avoid: See is_enabled
Avoid: See is_enabled
Avoid: See is_enabled
Avoid: See is_enabled
Pass Drain through a closure, eg. to wrap
into another Drain. Read more
Filter logging records passed to Drain Read more
Filter logging records passed to Drain (by level) Read more
Map logging errors returned by this drain Read more
Ignore results returned by this drain Read more
Auto Trait Implementations
impl<D> Send for SentryDrain<D> where
D: Send,
impl<D> Sync for SentryDrain<D> where
D: Sync,
impl<D> Unpin for SentryDrain<D> where
D: Unpin,
Blanket Implementations
Mutably borrows from an owned value. Read more
