pub struct Record<'a> {
pub session_id: u64,
pub time: &'a str,
pub level: LogLevel,
pub component: &'a str,
pub description: &'a str,
pub format: Format,
pub attributes: &'a Attributes,
pub host: &'a str,
}Expand description
A borrowed view of one log record: the fields of rlg::Log, plus
the host name the Apache access-log format prints.
Rendering it (Record::write_to, or Display) writes the record
in Record::format, byte for byte as rlg::Log does. Nothing is
allocated except for logfmt array and object attribute values.
Fields§
§session_id: u64Monotonic session identifier.
time: &'a strTimestamp, written as given.
level: LogLevelSeverity level.
component: &'a strOriginating service or module name.
description: &'a strHuman-readable message body.
format: FormatOutput format.
attributes: &'a AttributesKey-value attributes.
host: &'a strHost name, written only by Format::ApacheAccessLog.
Implementations§
Source§impl<'a> Record<'a>
impl<'a> Record<'a>
Sourcepub const fn new(level: LogLevel, description: &'a str) -> Self
pub const fn new(level: LogLevel, description: &'a str) -> Self
A record at level with description, session 0, an empty
timestamp and host, component "default", no attributes, in
Format::MCP (the defaults of rlg::Log::build, minus the
clock and counter, which need std).
Sourcepub const fn session_id(self, session_id: u64) -> Self
pub const fn session_id(self, session_id: u64) -> Self
Set the session identifier.
Sourcepub const fn attributes(self, attributes: &'a Attributes) -> Self
pub const fn attributes(self, attributes: &'a Attributes) -> Self
Set the attributes.