Struct simplelog::ConfigBuilder[][src]

#[non_exhaustive]
pub struct ConfigBuilder(_);
Expand description

Builder for the Logger Configurations (Config)

All loggers print the message in the following form: 00:00:00 [LEVEL] crate::module: [lib.rs::100] your_message Every space delimited part except the actual message is optional.

Use this struct to create a custom Config changing when these information shall be logged. Every part can be enabled for a specific Level and is then automatically enable for all lower levels as well.

The Result is that the logging gets more detailed the more verbose it gets. E.g. to have one part shown always use Level::Error. But if you want to show the source line only on Trace use that.

Implementations

Create a new default ConfigBuilder

Set at which level and above (more verbose) the level itself shall be logged (default is Error)

Set at which level and above (more verbose) the current time shall be logged (default is Error)

Set at which level and above (more verbose) the thread id shall be logged. (default is Debug)

Set at which level and above (more verbose) the target shall be logged. (default is Debug)

Set at which level and above (more verbose) a source code reference shall be logged (default is Trace)

Set how the levels should be padded, when logging (default is Off)

Set how the thread should be padded

Set the mode for logging the thread

Set the color used for printing the level (if the logger supports it), or None to use the default foreground color

Set time chrono strftime format string.

Set time chrono strftime format string.

Set offset used for logging time (default is 0)

set if you log in local timezone or UTC (default is UTC)

Add allowed module filters. If any are specified, only records from modules starting with one of these entries will be printed

For example, add_filter_allow_str("tokio::uds") would allow only logging from the tokio crates uds module.

Add allowed module filters. If any are specified, only records from modules starting with one of these entries will be printed

For example, add_filter_allow(format!("{}{}","tokio", "uds")) would allow only logging from the tokio crates uds module.

Clear allowed module filters. If none are specified, nothing is filtered out

Add denied module filters. If any are specified, records from modules starting with one of these entries will be ignored

For example, add_filter_ignore_str("tokio::uds") would deny logging from the tokio crates uds module.

Add denied module filters. If any are specified, records from modules starting with one of these entries will be ignored

For example, add_filter_ignore(format!("{}{}","tokio", "uds")) would deny logging from the tokio crates uds module.

Clear ignore module filters. If none are specified, nothing is filtered

Build new Config

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.