pub struct LogRecord {
pub severity: Severity,
pub source: LogSource,
pub body: String,
pub logger: Option<String>,
pub function: Option<String>,
pub file: Option<String>,
pub line: Option<u32>,
pub timestamp_ns: Option<u64>,
pub span_id: Option<u64>,
}Expand description
A log line as the platform captured it, where it happened. The core turns it into a record:
semconv code.* attributes, lk.log.source, lk.log.logger, filed under the span’s session.
Stamp timestamp_ns at capture; the record may cross an executor hop before it gets here.
Fields§
§severity: SeverityHow serious the line is; the core applies the source’s floor to it.
source: LogSourceWho wrote the line: it picks the floor, and is exported as lk.log.source.
body: StringThe line itself (the OTLP log body). Not message: AGENTS.md keeps that name off every
exported record.
logger: Option<String>The logger: a type, module or file name (Room, livekit::rtc_engine, sctp.cc),
exported as lk.log.logger to group lines in the backend.
function: Option<String>The function that logged, exported as code.function.name.
file: Option<String>The source file, exported as code.file.path.
line: Option<u32>The line in file, exported as code.line.number (0 is no line).
timestamp_ns: Option<u64>When the line was logged, in nanoseconds since the Unix epoch; None is stamped when the
record is queued.
span_id: Option<u64>The in-flight span this line was logged under, if any.