pub struct Config {
pub appends: SyncVec<Mutex<Box<dyn LogAppender>>>,
pub level: LevelFilter,
pub filter: Box<dyn Filter>,
pub format: Box<dyn RecordFormat>,
pub chan_len: Option<usize>,
}
Expand description
the fast_log Config for example:
Fields§
§appends: SyncVec<Mutex<Box<dyn LogAppender>>>
Each appender is responsible for printing its own business
level: LevelFilter
the log level filter
filter: Box<dyn Filter>
filter log
format: Box<dyn RecordFormat>
format record into field fast_log_record’s formated:String
chan_len: Option<usize>
the channel length,default None(Unbounded channel)
Implementations§
source§impl Config
impl Config
pub fn new() -> Self
sourcepub fn level(self, level: LevelFilter) -> Self
pub fn level(self, level: LevelFilter) -> Self
set log LevelFilter
sourcepub fn format<F: RecordFormat + 'static>(self, format: F) -> Self
pub fn format<F: RecordFormat + 'static>(self, format: F) -> Self
set log format
sourcepub fn file_split<P: Packer + 'static>(
self,
file_path: &str,
temp_size: LogSize,
rolling_type: RollingType,
packer: P
) -> Self
pub fn file_split<P: Packer + 'static>( self, file_path: &str, temp_size: LogSize, rolling_type: RollingType, packer: P ) -> Self
add a FileSplitAppender
sourcepub fn custom<Appender: LogAppender + 'static>(self, arg: Appender) -> Self
pub fn custom<Appender: LogAppender + 'static>(self, arg: Appender) -> Self
add a custom LogAppender
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl !UnwindSafe for Config
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