[][src]Struct simplelog::ConfigBuilder

pub struct ConfigBuilder(_);

Builder for the Logger Confogurations (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.

Methods

impl ConfigBuilder[src]

pub fn new() -> ConfigBuilder[src]

Create a new default ConfigBuilder

pub fn set_max_level<'a>(
    &'a mut self,
    level: LevelFilter
) -> &'a mut ConfigBuilder
[src]

Set at which level and below the level itself shall be logged (default is Error)

pub fn set_time_level<'a>(
    &'a mut self,
    time: LevelFilter
) -> &'a mut ConfigBuilder
[src]

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

pub fn set_thread_level<'a>(
    &'a mut self,
    thread: LevelFilter
) -> &'a mut ConfigBuilder
[src]

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

pub fn set_target_level<'a>(
    &'a mut self,
    target: LevelFilter
) -> &'a mut ConfigBuilder
[src]

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

pub fn set_location_level<'a>(
    &'a mut self,
    location: LevelFilter
) -> &'a mut ConfigBuilder
[src]

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

pub fn set_level_padding<'a>(
    &'a mut self,
    padding: LevelPadding
) -> &'a mut ConfigBuilder
[src]

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

pub fn set_time_format_str<'a>(
    &'a mut self,
    time_format: &'static str
) -> &'a mut ConfigBuilder
[src]

Set time chrono strftime format string. See: https://docs.rs/chrono/0.4.0/chrono/format/strftime/index.html#specifiers

pub fn set_time_format<'a>(
    &'a mut self,
    time_format: String
) -> &'a mut ConfigBuilder
[src]

Set time chrono strftime format string. See: https://docs.rs/chrono/0.4.0/chrono/format/strftime/index.html#specifiers

pub fn set_time_offset<'a>(
    &'a mut self,
    time_offset: FixedOffset
) -> &'a mut ConfigBuilder
[src]

Set offset used for logging time (default is 0)

pub fn set_time_to_local<'a>(&'a mut self, local: bool) -> &'a mut ConfigBuilder[src]

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

pub fn add_filter_allow_str<'a>(
    &'a mut self,
    time_format: &'static str
) -> &'a mut ConfigBuilder
[src]

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.

pub fn add_filter_allow<'a>(
    &'a mut self,
    time_format: String
) -> &'a mut ConfigBuilder
[src]

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.

pub fn clear_filter_allow<'a>(&'a mut self) -> &'a mut ConfigBuilder[src]

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

pub fn add_filter_ignore_str<'a>(
    &'a mut self,
    time_format: &'static str
) -> &'a mut ConfigBuilder
[src]

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.

pub fn add_filter_ignore<'a>(
    &'a mut self,
    time_format: String
) -> &'a mut ConfigBuilder
[src]

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.

pub fn clear_filter_ignore<'a>(&'a mut self) -> &'a mut ConfigBuilder[src]

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

pub fn build(&mut self) -> Config[src]

Build new Config

Trait Implementations

impl Clone for ConfigBuilder[src]

impl Debug for ConfigBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]