Struct task_log::ConfigBuilder
source · [−]Expand description
Configure task_log using this interactive configuration struct.
This is done by calling methods an instance of the struct to configure it and then calling .apply() to apply that configuration. Behind the scenes this updates the static mutex holding the configuration.
Example:
use task_log::ConfigBuilder;
ConfigBuilder::new()
.color(false)
.duration(false)
.apply()
.expect("Failed to configure logger");Fields
color: boolIf the prefix (e.g. “DONE” or “RUNNING”) should be in color.
duration: boolIf the duration that the task took should be included in the prefix (e.g. “DONE”) at the end of the task.
Implementations
sourceimpl ConfigBuilder
impl ConfigBuilder
sourcepub fn apply<'a>(self) -> Result<(), PoisonError<MutexGuard<'a, Self>>>
pub fn apply<'a>(self) -> Result<(), PoisonError<MutexGuard<'a, Self>>>
Apply the configuration
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more