pub struct LoggingConfig {
pub format: LogFormat,
pub default_level: Level,
pub include_location: bool,
pub include_thread_ids: bool,
pub log_spans: bool,
pub otel_service_name: Option<String>,
pub otel_endpoint: Option<String>,
pub otel_traces_endpoint: Option<String>,
pub otel_metrics_endpoint: Option<String>,
}Fields§
§format: LogFormat§default_level: LevelFilter level used when RUST_LOG is unset. Foreground CLI commands
default this to Warn; -v raises to Info, -vv to Debug, -vvv
to Trace; --quiet lowers to Error. RUST_LOG always overrides.
include_location: bool§include_thread_ids: bool§log_spans: bool§otel_service_name: Option<String>§otel_endpoint: Option<String>§otel_traces_endpoint: Option<String>§otel_metrics_endpoint: Option<String>Implementations§
Source§impl LoggingConfig
impl LoggingConfig
pub fn from_env() -> Self
pub fn from_user_and_env(user_config: Option<&UserConfig>) -> Self
pub fn with_format(self, format: LogFormat) -> Self
Sourcepub fn with_verbosity(self, verbose: u8, quiet: bool) -> Self
pub fn with_verbosity(self, verbose: u8, quiet: bool) -> Self
Map CLI -v/--quiet counts to a default log level.
quiet wins over verbose; RUST_LOG overrides both downstream.
0 → keep current (e.g. Warn for foreground), 1 → Info, 2 → Debug,
3+ → Trace.
pub fn with_location(self, include: bool) -> Self
pub fn with_thread_ids(self, include: bool) -> Self
pub fn with_spans(self, include: bool) -> Self
Trait Implementations§
Source§impl Clone for LoggingConfig
impl Clone for LoggingConfig
Source§fn clone(&self) -> LoggingConfig
fn clone(&self) -> LoggingConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 LoggingConfig
impl Debug for LoggingConfig
Auto Trait Implementations§
impl Freeze for LoggingConfig
impl RefUnwindSafe for LoggingConfig
impl Send for LoggingConfig
impl Sync for LoggingConfig
impl Unpin for LoggingConfig
impl UnsafeUnpin for LoggingConfig
impl UnwindSafe for LoggingConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request