LogRecord class

Represents a log record containing all relevant data for a logging event.

Constructors

LogRecord({required DateTime time, required Level level, required String message, Context? context, StackTrace? stackTrace, bool stackTraceProvided = false})
Creates a new LogRecord instance with the given parameters.

Properties

context Context
The context associated with the log event. Stores key-value pairs for additional metadata.
final
hashCode int
The hash code for this object.
no setterinherited
level Level
The log level of the event.
final
message String
The log message.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackTrace StackTrace?
The program counter or stack trace at the time the record was constructed.
final
stackTraceProvided bool
Whether the stack trace was explicitly provided by the caller.
final
time DateTime
The time at which the log event occurred.
final

Methods

clone() LogRecord
Returns a copy of the record with no shared state.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts the log record to a JSON-compatible map. Only includes stackTrace if it was explicitly provided by the caller.
toString() String
A string representation of this object.
inherited

Operators

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