pub struct Builder { /* private fields */ }
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn new() -> Builder
pub fn new() -> Builder
Create a ftlog builder with default settings:
- global log level: INFO
- root log level: INFO
- default formatter:
FtLogFormatter
- output to stderr
- bounded channel between worker thread and log thread, with a size limit of 100_000
- discard excessive log messages
- log with timestamp of local timezone
Sourcepub fn format<F: FtLogFormat + 'static>(self, format: F) -> Builder
pub fn format<F: FtLogFormat + 'static>(self, format: F) -> Builder
Set custom formatter
Sourcepub fn unbounded(self) -> Builder
pub fn unbounded(self) -> Builder
set channel size to unbound
ATTENTION: too much log message will lead to huge memory consumption, as log messages are queued to be handled by log thread. When log message exceed the current channel size, it will double the size by default, Since channel expansion asks for memory allocation, log calls can be slow down.
Sourcepub fn max_log_level(self, level: LevelFilter) -> Builder
pub fn max_log_level(self, level: LevelFilter) -> Builder
Set max log level
Logs with level more verbose than this will not be sent to log thread.
Sourcepub fn root_log_level(self, level: LevelFilter) -> Builder
pub fn root_log_level(self, level: LevelFilter) -> Builder
Set max log level
Logs with level more verbose than this will not be sent to log thread.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl !RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl !UnwindSafe for Builder
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