pub struct LogSink { /* private fields */ }Expand description
Always-compiled operational logger for the SPARQL executor.
Every line includes query_id. Unlike TraceSink, this is not compiled
out of release builds.
Implementations§
Source§impl LogSink
impl LogSink
Sourcepub fn file(min: LogLevel, file: Arc<Mutex<File>>) -> Self
pub fn file(min: LogLevel, file: Arc<Mutex<File>>) -> Self
Append messages at min or more severe to an already-open file.
The handle is shared (Arc<Mutex<..>>) so a caller can hand the same
file to TraceSink::file and keep one interleaved debug log. Write
failures are swallowed: a lost diagnostic line must not abort a query.
Sourcepub fn capture(min: LogLevel, lines: Arc<Mutex<Vec<String>>>) -> Self
pub fn capture(min: LogLevel, lines: Arc<Mutex<Vec<String>>>) -> Self
Capture messages for tests (min still applies).
Sourcepub fn enabled_at(&self, level: LogLevel) -> bool
pub fn enabled_at(&self, level: LogLevel) -> bool
Whether level would be emitted.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LogSink
impl RefUnwindSafe for LogSink
impl Send for LogSink
impl Sync for LogSink
impl Unpin for LogSink
impl UnsafeUnpin for LogSink
impl UnwindSafe for LogSink
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,
§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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].