pub struct TracingConfig {
pub ansi: bool,
pub file: bool,
pub level: LogLevel,
pub line_number: bool,
pub target: bool,
pub thread_ids: bool,
pub thread_names: bool,
pub timer: bool,
}Fields§
§ansi: bool§file: bool§level: LogLevel§line_number: bool§target: bool§thread_ids: bool§thread_names: bool§timer: boolImplementations§
Source§impl TracingConfig
impl TracingConfig
Sourcepub const fn new(level: LogLevel) -> Self
pub const fn new(level: LogLevel) -> Self
initialize a new instance of the tracing configuration from the given log level
Sourcepub const fn line_number(&self) -> bool
pub const fn line_number(&self) -> bool
returns true if the line numbers are enabled
Sourcepub const fn thread_ids(&self) -> bool
pub const fn thread_ids(&self) -> bool
returns true if thread ids are enabled
Sourcepub const fn thread_names(&self) -> bool
pub const fn thread_names(&self) -> bool
returns true if thread names are enabled
Sourcepub const fn set_ansi(&mut self, ansi: bool) -> &mut Self
pub const fn set_ansi(&mut self, ansi: bool) -> &mut Self
update the ansi setting and return a mutable reference to self
Sourcepub const fn set_level(&mut self, level: LogLevel) -> &mut Self
pub const fn set_level(&mut self, level: LogLevel) -> &mut Self
update the log level and return a mutable reference to self
Sourcepub const fn set_line_number(&mut self, line_number: bool) -> &mut Self
pub const fn set_line_number(&mut self, line_number: bool) -> &mut Self
update if the line number should be displayed
Sourcepub const fn set_target(&mut self, target: bool) -> &mut Self
pub const fn set_target(&mut self, target: bool) -> &mut Self
update the target flag and return a mutable reference to self.
Sourcepub const fn set_thread_ids(&mut self, thread_ids: bool) -> &mut Self
pub const fn set_thread_ids(&mut self, thread_ids: bool) -> &mut Self
update the thread ids flag and return a mutable reference to self.
Sourcepub const fn set_thread_names(&mut self, thread_names: bool) -> &mut Self
pub const fn set_thread_names(&mut self, thread_names: bool) -> &mut Self
update the thread names flag and return a mutable reference to self.
pub const fn set_timer(&mut self, timer: bool) -> &mut Self
pub fn with_ansi(self, ansi: bool) -> Self
pub fn with_file(self, file: bool) -> Self
pub fn with_level(self, level: LogLevel) -> Self
pub fn with_line_number(self, line_number: bool) -> Self
pub fn with_target(self, target: bool) -> Self
pub fn with_thread_ids(self, thread_ids: bool) -> Self
pub fn with_thread_names(self, thread_names: bool) -> Self
Sourcepub fn get_env_filter(&self, name: &str) -> EnvFilter
pub fn get_env_filter(&self, name: &str) -> EnvFilter
create an env filter from the current configuration
Sourcepub fn init_tracing(&self, name: &str)
pub fn init_tracing(&self, name: &str)
Initialize the tracer with the given name
Trait Implementations§
Source§impl Clone for TracingConfig
impl Clone for TracingConfig
Source§fn clone(&self) -> TracingConfig
fn clone(&self) -> TracingConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TracingConfig
impl Debug for TracingConfig
Source§impl Default for TracingConfig
impl Default for TracingConfig
Source§impl<'de> Deserialize<'de> for TracingConfigwhere
TracingConfig: Default,
impl<'de> Deserialize<'de> for TracingConfigwhere
TracingConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TracingConfig
impl Display for TracingConfig
Source§impl Hash for TracingConfig
impl Hash for TracingConfig
Source§impl Ord for TracingConfig
impl Ord for TracingConfig
Source§fn cmp(&self, other: &TracingConfig) -> Ordering
fn cmp(&self, other: &TracingConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for TracingConfig
impl PartialEq for TracingConfig
Source§impl PartialOrd for TracingConfig
impl PartialOrd for TracingConfig
Source§impl Serialize for TracingConfig
impl Serialize for TracingConfig
impl Copy for TracingConfig
impl Eq for TracingConfig
impl StructuralPartialEq for TracingConfig
Auto Trait Implementations§
impl Freeze for TracingConfig
impl RefUnwindSafe for TracingConfig
impl Send for TracingConfig
impl Sync for TracingConfig
impl Unpin for TracingConfig
impl UnwindSafe for TracingConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more