LogEntry class

Immutable log entry containing structured data.

Includes:

  • Timestamp (UTC)
  • Log level
  • Message
  • Context (inherited from logger)
  • Optional metadata (per-log)

Constructors

LogEntry({required LogLevel level, required String message, Map<String, dynamic>? metadata, Map<String, dynamic>? context})
Creates a new log entry.

Properties

context Map<String, dynamic>
Contextual data inherited from the logger (e.g., request ID, user).
final
hashCode int
The hash code for this object.
no setterinherited
level LogLevel
Severity level.
final
message String
Primary log message.
final
metadata Map<String, dynamic>?
Optional one-off metadata for this log entry.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timestamp DateTime
UTC timestamp when the log was created.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes the entry to JSON-compatible map.
toString() String
Human-readable string representation.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited