pub struct LoggerConfig { /* private fields */ }Expand description
The configuration of the logger.
Implementations§
Source§impl LoggerConfig
Inherent implementation of LoggerConfig.
impl LoggerConfig
Inherent implementation of LoggerConfig.
Sourcepub fn new(level: LevelFilter) -> Self
pub fn new(level: LevelFilter) -> Self
Creates a new LoggerConfig with the specified maximum log level.
§Arguments
LevelFilter- Maximum severity level written by the logger.
§Returns
Self- Constructed configuration.
Sourcepub fn get_level(&self) -> LevelFilter
pub fn get_level(&self) -> LevelFilter
Sourcepub fn get_console(&self) -> bool
pub fn get_console(&self) -> bool
Returns whether standard output console logging is enabled.
§Returns
bool-truewhen console logging is enabled.
Sourcepub fn get_format(&self) -> LogFormat
pub fn get_format(&self) -> LogFormat
Sourcepub fn get_channel_capacity(&self) -> usize
pub fn get_channel_capacity(&self) -> usize
Returns the bounded non-blocking background writer channel capacity.
§Returns
usize- Maximum queued log records before dropping.
Sourcepub fn set_level(&mut self, level: LevelFilter) -> &mut Self
pub fn set_level(&mut self, level: LevelFilter) -> &mut Self
Sets the maximum LevelFilter in place.
§Arguments
LevelFilter- Desired maximum severity level.
§Returns
&mut Self- Mutable reference for fluent chaining.
Sourcepub fn set_console(&mut self, enabled: bool) -> &mut Self
pub fn set_console(&mut self, enabled: bool) -> &mut Self
Sourcepub fn set_format(&mut self, format: LogFormat) -> &mut Self
pub fn set_format(&mut self, format: LogFormat) -> &mut Self
Sourcepub fn set_channel_capacity(&mut self, capacity: usize) -> &mut Self
pub fn set_channel_capacity(&mut self, capacity: usize) -> &mut Self
Sourcepub fn with_level(self, level: LevelFilter) -> Self
pub fn with_level(self, level: LevelFilter) -> Self
Updates the maximum LevelFilter.
§Arguments
LevelFilter- Desired maximum severity level.
§Returns
Self- Updated configuration.
Sourcepub fn with_console(self, enabled: bool) -> Self
pub fn with_console(self, enabled: bool) -> Self
Sourcepub fn with_format(self, format: LogFormat) -> Self
pub fn with_format(self, format: LogFormat) -> Self
Sourcepub fn with_channel_capacity(self, capacity: usize) -> Self
pub fn with_channel_capacity(self, capacity: usize) -> Self
Trait Implementations§
Source§impl Clone for LoggerConfig
impl Clone for LoggerConfig
Source§impl Debug for LoggerConfig
Formatting / debug-printing for LoggerConfig.
impl Debug for LoggerConfig
Formatting / debug-printing for LoggerConfig.
Source§impl Default for LoggerConfig
Default construction for LoggerConfig.
impl Default for LoggerConfig
Default construction for LoggerConfig.
Auto Trait Implementations§
impl !RefUnwindSafe for LoggerConfig
impl !UnwindSafe for LoggerConfig
impl Forget for LoggerConfig
impl Freeze for LoggerConfig
impl Move for LoggerConfig
impl Send for LoggerConfig
impl Sync for LoggerConfig
impl Unpin for LoggerConfig
impl UnsafeUnpin for LoggerConfigwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<dyn LogSink> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn LogSink>>: UnsafeUnpin,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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