pub struct ConfigBuilder {
    pub color: bool,
    pub duration: bool,
}
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: bool

If the prefix (e.g. “DONE” or “RUNNING”) should be in color.

duration: bool

If the duration that the task took should be included in the prefix (e.g. “DONE”) at the end of the task.

Implementations

Create a new ConfigBuilder off of the default struct values.

Set the color value

Set the duration value

Apply the configuration

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.