pub struct RethTracer { /* private fields */ }
Expand description
Tracer for application logging.
Manages the configuration and initialization of logging layers, including standard output, optional journald, and optional file logging.
Implementations§
Source§impl RethTracer
impl RethTracer
Sourcepub fn new() -> Self
pub fn new() -> Self
Constructs a new Tracer
with default settings.
Initializes with default stdout layer configuration. Journald and file layers are not set by default.
Sourcepub fn with_stdout(self, config: LayerInfo) -> Self
pub fn with_stdout(self, config: LayerInfo) -> Self
Sets a custom configuration for the stdout layer.
§Arguments
config
- TheLayerInfo
to use for the stdout layer.
Sourcepub fn with_journald(self, filter: String) -> Self
pub fn with_journald(self, filter: String) -> Self
Trait Implementations§
Source§impl Clone for RethTracer
impl Clone for RethTracer
Source§fn clone(&self) -> RethTracer
fn clone(&self) -> RethTracer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RethTracer
impl Debug for RethTracer
Source§impl Default for RethTracer
impl Default for RethTracer
Source§impl Tracer for RethTracer
impl Tracer for RethTracer
Source§fn init(self) -> Result<Option<WorkerGuard>>
fn init(self) -> Result<Option<WorkerGuard>>
Initializes the logging system based on the configured layers.
This method sets up the global tracing subscriber with the specified stdout, journald, and file layers.
The default layer is stdout.
§Returns
An eyre::Result
which is Ok
with an optional WorkerGuard
if a file layer is used,
or an Err
in case of an error during initialization.
Auto Trait Implementations§
impl Freeze for RethTracer
impl RefUnwindSafe for RethTracer
impl Send for RethTracer
impl Sync for RethTracer
impl Unpin for RethTracer
impl UnwindSafe for RethTracer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 248 bytes