LogEntry class

Structured representation of a log event passed to handlers.

Single source of truth for all log data. Handlers receive this object and decide how to format and where to output.

Constructors

LogEntry({required String loggerName, required String origin, required LogLevel level, required String message, required String timestamp, List<CallbackInfo>? stackFrames, Object? error, StackTrace? stackTrace, Map<String, dynamic>? context})

Properties

context ↔ Map<String, dynamic>?
Structured context map.
getter/setter pair
error ↔ Object?
Associated error object.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
hierarchyDepth → int
Hierarchy depth calculated from loggerName.
no setter
level ↔ LogLevel
Log severity level.
getter/setter pair
loggerName ↔ String
Name of the logger that created this entry.
getter/setter pair
message ↔ String
Log message content.
getter/setter pair
origin ↔ String
Caller origin string (e.g., 'Class.method').
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stackFrames ↔ List<CallbackInfo>?
Parsed stack frames if included.
getter/setter pair
stackTrace ↔ StackTrace?
Full stack trace.
getter/setter pair
timestamp ↔ String
Formatted timestamp.
getter/setter pair

Methods

clone() → LogEntry
Creates an independent clone of this LogEntry detached from any object pool.
copyWith({String? loggerName, String? origin, LogLevel? level, String? message, String? timestamp, List<CallbackInfo>? stackFrames, Object? error, StackTrace? stackTrace, Map<String, dynamic>? context}) → LogEntry
Creates a copy of this entry with optional overrides. Note: copyWith does not preserve the cached hierarchy depth, as the new instance will recompute it on first access.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Resets the entry for reuse in the pool.
toString() → String
A string representation of this object.
override

Operators

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