silk.trace.log.

Records structured ambient log events with the current W3C trace and span identifiers.

Import as OtelLogger with import silk.trace.log { OtelLogger }.

Public declarations: 2.

OtelLogger#

silk
pub struct OtelLogger

An ambient Logger provider that appends OpenTelemetry logs to a recorder.

Implementation OtelLogger#

silk
impl OtelLogger

Associated function make#

silk
pub fn make(recorder: &Arc<Recorder>) -> Self

Shares the recorder's queue with an ambient log scope.

Method forwarding#

silk
pub fn forwarding<P: Concurrent + Transferable>(self: Self, inner: &Arc<P>) -> ForwardingLogger<P>

Returns a provider that both records and forwards every event to the supplied Logger provider.

Implementation Logger for OtelLogger#

silk
impl Logger for OtelLogger

Operation log#

silk
effect fn log<Args>(self: &Self, level: LogLevel, static template: string<'static>, args: &Args) -> ()

ForwardingLogger#

silk
pub struct ForwardingLogger<P>

An OpenTelemetry logger that also supplies the event to an inner ambient provider.

Implementation Logger for ForwardingLogger<P>#

silk
impl<P: Concurrent + Transferable> Logger for ForwardingLogger<P>

Operation log#

silk
effect fn log<Args>(self: &Self, level: LogLevel, static template: string<'static>, args: &Args) -> ()

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc, wasm64-unknown-unknown.

View the source of this page