std:logging/LogEvent
std:logging/LogEvent
Section titled “std:logging/LogEvent”Canonical occurrence:
protos/lib/logging/LogEvent.protos· Protos revision:e99b712ecf658a527b1fe82c8beba2c1286d8dc9.
Immutable structured log events. An event is a frozen ordinary object with
a level slot holding a canonical std:logging/Level, a String message,
a frozen standard Map fields of structured data, an error slot holding
the attached Error or null, and a timestamp slot holding a
std:datetime/Instant or null. Every event has all five slots; an event
without a time has timestamp null.
Structured data is ordinary Protos data drawn only from null, true,
false, Strings, Integers, Floats, standard Arrays, and normal standard
Maps whose keys are Strings, nested to any depth. An event never converts
another value to a String and never invokes its behavior; such a value
signals an Error instead. Field order is not part of an event’s meaning.
An event owns a snapshot of its fields: every Array and Map is copied and the copy frozen, so later mutation of the supplied data, at any depth, does not change the event. Core freeze is shallow, which is why the copy is taken at every level. A supplied Array or Map that contains itself, directly or indirectly, signals an Error.
The attached Error is kept by reference: it is neither copied, mutated, signalled, nor converted. The timestamp is kept by reference as supplied; an event never reads a current time. An event carries no formatter, sink, writer, clock, or other ambient authority.
Every event’s immediate delegation parent is this module, the canonical
event factory and prototype. recognizes accepts exactly the events of
this family: frozen objects whose immediate parent is this module, whose
local slots are exactly level, message, fields, error, and
timestamp, and whose slots hold valid event state. Recognition reads that
state directly, so it never invokes behavior of the candidate; an object
that merely has similar slots is not an event.
Observable top-level slots
Section titled “Observable top-level slots”This page lists the complete mechanically observable top-level slot inventory required by D067. Authored documentation, when present, is canonical D062 prose; mechanical presence alone does not create a stability or compatibility promise.
Answers a fresh frozen event for level, message, fields, error, and
timestamp.
level must be a canonical level and message a String. fields must be
a normal standard Map of structured data, or null for no fields; the
event’s fields slot is always a frozen Map snapshot. error must be an
object that delegates to Error, or null. timestamp must be an instant
recognized by std:datetime/Instant, or null, the default, for an event
without a time. Any other argument signals an Error.
Mechanical facts
Section titled “Mechanical facts”No callable shape is mechanically recorded for this slot.
- Source occurrence:
protos/lib/logging/LogEvent.protos:56 - Exact source page: open in the source browser
recognizes
Section titled “recognizes”Answers true exactly when value is an event of this family: a frozen
object whose immediate delegation parent is this module, whose local slots
are exactly level, message, fields, error, and timestamp, and
whose level is a canonical level, message a String, fields a frozen
standard Map of structured data frozen at every depth, error an Error or
null, and timestamp a std:datetime/Instant or null.
Answers false for any other value, including this module. The candidate
is neither copied, converted, nor sent any message.
Mechanical facts
Section titled “Mechanical facts”No callable shape is mechanically recorded for this slot.
- Source occurrence:
protos/lib/logging/LogEvent.protos:171 - Exact source page: open in the source browser
Exact module source · Standard-library API · Standard library overview