Struct simplelog::ConfigBuilder [−][src]
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
impl ConfigBuilder
[src]
pub fn new() -> ConfigBuilder
[src]
Create a new default ConfigBuilder
pub fn set_max_level(&mut self, level: LevelFilter) -> &mut ConfigBuilder
[src]
Set at which level and above (more verbose) the level itself shall be logged (default is Error)
pub fn set_time_level(&mut self, time: LevelFilter) -> &mut ConfigBuilder
[src]
Set at which level and above (more verbose) the current time shall be logged (default is Error)
pub fn set_thread_level(&mut self, thread: LevelFilter) -> &mut ConfigBuilder
[src]
Set at which level and above (more verbose) the thread id shall be logged. (default is Debug)
pub fn set_target_level(&mut self, target: LevelFilter) -> &mut ConfigBuilder
[src]
Set at which level and above (more verbose) the target shall be logged. (default is Debug)
pub fn set_location_level(
&mut self,
location: LevelFilter
) -> &mut ConfigBuilder
[src]
&mut self,
location: LevelFilter
) -> &mut ConfigBuilder
Set at which level and above (more verbose) a source code reference shall be logged (default is Trace)
pub fn set_level_padding(&mut self, padding: LevelPadding) -> &mut ConfigBuilder
[src]
Set how the levels should be padded, when logging (default is Left)
pub fn set_thread_padding(
&mut self,
padding: ThreadPadding
) -> &mut ConfigBuilder
[src]
&mut self,
padding: ThreadPadding
) -> &mut ConfigBuilder
Set how the thread should be padded
pub fn set_thread_mode(&mut self, mode: ThreadLogMode) -> &mut ConfigBuilder
[src]
Set the mode for logging the thread
pub fn set_level_color(
&mut self,
level: Level,
color: Option<Color>
) -> &mut ConfigBuilder
[src]
&mut self,
level: Level,
color: Option<Color>
) -> &mut ConfigBuilder
Set the color used for printing the level (if the logger supports it), or None to use the default foreground color
pub fn set_time_format_str(
&mut self,
time_format: &'static str
) -> &mut ConfigBuilder
[src]
&mut self,
time_format: &'static str
) -> &mut ConfigBuilder
Set time chrono strftime format string.
pub fn set_time_format(&mut self, time_format: String) -> &mut ConfigBuilder
[src]
Set time chrono strftime format string.
pub fn set_time_offset(
&mut self,
time_offset: FixedOffset
) -> &mut ConfigBuilder
[src]
&mut self,
time_offset: FixedOffset
) -> &mut ConfigBuilder
Set offset used for logging time (default is 0)
pub fn set_time_to_local(&mut self, local: bool) -> &mut ConfigBuilder
[src]
set if you log in local timezone or UTC (default is UTC)
pub fn add_filter_allow_str(
&mut self,
filter_allow: &'static str
) -> &mut ConfigBuilder
[src]
&mut self,
filter_allow: &'static str
) -> &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(&mut self, filter_allow: String) -> &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(&mut self) -> &mut ConfigBuilder
[src]
Clear allowed module filters. If none are specified, nothing is filtered out
pub fn add_filter_ignore_str(
&mut self,
filter_ignore: &'static str
) -> &mut ConfigBuilder
[src]
&mut self,
filter_ignore: &'static str
) -> &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(&mut self, filter_ignore: String) -> &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(&mut self) -> &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]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ConfigBuilder
[src]
impl Default for ConfigBuilder
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,