pub struct ConfigBuilder { /* private fields */ }Expand description
Builder for configuring and initializing the logger.
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn maybe_with_log_file<P: AsRef<Path>>(
self,
path: Option<P>,
) -> Result<Self, Error>
pub fn maybe_with_log_file<P: AsRef<Path>>( self, path: Option<P>, ) -> Result<Self, Error>
Maybe sets a log file.
Sourcepub fn with_time_rotation(
self,
config: TimeRotationConfig,
) -> Result<Self, Error>
pub fn with_time_rotation( self, config: TimeRotationConfig, ) -> Result<Self, Error>
Sets time-based log file rotation.
Sourcepub fn with_size_rotation(
self,
config: SizeRotationConfig,
) -> Result<Self, Error>
pub fn with_size_rotation( self, config: SizeRotationConfig, ) -> Result<Self, Error>
Sets size-based log file rotation.
Sourcepub fn with_stdout(self, yes: bool) -> Self
pub fn with_stdout(self, yes: bool) -> Self
Dynamically set the stdout flag.
Sourcepub fn maybe_with_name(self, name: Option<&str>) -> Self
pub fn maybe_with_name(self, name: Option<&str>) -> Self
Maybe sets a log name
Sourcepub async fn scope_global<F: Future>(self, f: F) -> F::Output
pub async fn scope_global<F: Future>(self, f: F) -> F::Output
Initialize the logger globally and run the provided future. The logger is automatically shut down when the future completes.
pub async fn scope_local<F: Future>(self, f: F) -> F::Output
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
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