pub struct LogConfig {
pub min_level: LogLevel,
pub json_output: bool,
pub include_target: bool,
pub max_fields: usize,
}Expand description
Configuration for the logging system.
Fields§
§min_level: LogLevelMinimum log level to emit.
json_output: boolWhether to output JSON (true) or compact format (false).
include_target: boolWhether to include the target module path.
max_fields: usizeMaximum number of structured fields per log entry.
Implementations§
Source§impl LogConfig
impl LogConfig
Sourcepub fn json_output(self, json: bool) -> Self
pub fn json_output(self, json: bool) -> Self
Sets whether to output JSON format.
Sourcepub fn include_target(self, include: bool) -> Self
pub fn include_target(self, include: bool) -> Self
Sets whether to include the target module path.
Sourcepub fn max_fields(self, max: usize) -> Self
pub fn max_fields(self, max: usize) -> Self
Sets the maximum structured fields per log.
Sourcepub fn development() -> Self
pub fn development() -> Self
Returns a development configuration (verbose, compact output).
Sourcepub fn production() -> Self
pub fn production() -> Self
Returns a production configuration (info+, JSON output).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LogConfig
impl RefUnwindSafe for LogConfig
impl Send for LogConfig
impl Sync for LogConfig
impl Unpin for LogConfig
impl UnwindSafe for LogConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).