Struct ringlog::SamplingLogBuilder
source · pub struct SamplingLogBuilder { /* private fields */ }
Expand description
A type to construct a basic RingLog
which routes 1 in N log messages to a
single Output
.
Implementations§
source§impl SamplingLogBuilder
impl SamplingLogBuilder
sourcepub fn log_queue_depth(self, messages: usize) -> Self
pub fn log_queue_depth(self, messages: usize) -> Self
Sets the depth of the log queue. Deeper queues are less likely to drop messages, but come at the cost of additional memory utilization.
sourcepub fn single_message_size(self, bytes: usize) -> Self
pub fn single_message_size(self, bytes: usize) -> Self
Sets the buffer size for a single message. Oversized messages will result in an extra allocation, but keeping this small allows deeper queues for the same total buffer size without dropping log messages.
sourcepub fn format(self, format: FormatFunction) -> Self
pub fn format(self, format: FormatFunction) -> Self
Sets the format function to be used to format messages to this log.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SamplingLogBuilder
impl !RefUnwindSafe for SamplingLogBuilder
impl Send for SamplingLogBuilder
impl Sync for SamplingLogBuilder
impl Unpin for SamplingLogBuilder
impl !UnwindSafe for SamplingLogBuilder
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