[−][src]Struct simplelog::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]
&'a mut self,
level: LevelFilter
) -> &'a mut ConfigBuilder
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]
&'a mut self,
time: LevelFilter
) -> &'a mut ConfigBuilder
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]
&'a mut self,
thread: LevelFilter
) -> &'a mut ConfigBuilder
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]
&'a mut self,
target: LevelFilter
) -> &'a mut ConfigBuilder
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]
&'a mut self,
location: LevelFilter
) -> &'a mut ConfigBuilder
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]
&'a mut self,
padding: LevelPadding
) -> &'a mut ConfigBuilder
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]
&'a mut self,
time_format: &'static str
) -> &'a mut ConfigBuilder
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]
&'a mut self,
time_format: String
) -> &'a mut ConfigBuilder
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]
&'a mut self,
time_offset: FixedOffset
) -> &'a mut ConfigBuilder
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]
&'a mut self,
time_format: &'static str
) -> &'a mut ConfigBuilder
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]
&'a mut self,
time_format: String
) -> &'a mut ConfigBuilder
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]
&'a mut self,
time_format: &'static str
) -> &'a mut ConfigBuilder
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]
&'a mut self,
time_format: String
) -> &'a mut ConfigBuilder
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]
fn clone(&self) -> ConfigBuilder
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ConfigBuilder
[src]
Auto Trait Implementations
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,