Logger implementation for emitting structured log records with trace context integration in OpenTelemetry Rust SDK.
// Source: https://github.com/open-telemetry/opentelemetry-rust | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
#[cfg(feature = "trace")]
use super::TraceContext;
use super::{SdkLogRecord, SdkLoggerProvider};
#[cfg(feature = "trace")]
use opentelemetry::trace::TraceContextExt;
use opentelemetry::{Context, InstrumentationScope};
use opentelemetry::logs::Severity;
use opentelemetry::time::now;
#[derive(Debug, Clone)]
/// The object for emitting [`LogRecord`]s.
///
/// [`LogRecord`]: opentelemetry::logs::LogRecord
pub struct SdkLogger {
scope: InstrumentationScope,
provider: SdkLoggerProvider,
// Bound is not strictly needed (no attributes), but the semconv is still
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key