pub struct GlogSink { /* private fields */ }Expand description
Glog sink that writes events in glog format to a file. This replaces the fmt::Layer that was previously used for text logging.
This only logs Events, not Spans (matching old fmt::Layer behavior).
Implementations§
Source§impl GlogSink
impl GlogSink
Sourcepub fn new(
writer: Box<dyn Write + Send>,
prefix_env_var: Option<String>,
file_log_level: &str,
) -> Self
pub fn new( writer: Box<dyn Write + Send>, prefix_env_var: Option<String>, file_log_level: &str, ) -> Self
Create a new glog sink with the given writer.
§Arguments
writer- Writer to write log events to (used directly without buffering)prefix_env_var- Optional environment variable name to read prefix from (matching old impl)file_log_level- Minimum log level to capture (e.g., “info”, “debug”)
Auto Trait Implementations§
impl Freeze for GlogSink
impl !RefUnwindSafe for GlogSink
impl Send for GlogSink
impl !Sync for GlogSink
impl Unpin for GlogSink
impl !UnwindSafe for GlogSink
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<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more