LogMessage constructor

const LogMessage({
  1. required String message,
  2. required LogLevel level,
  3. required DateTime timestamp,
  4. Object? error,
  5. StackTrace? stackTrace,
  6. Map<String, Object?>? context,
})

Constructs an instance of LogMessage.

  • message: The main content of the log message.
  • level: The severity level of the log message, represented by LogLevel.
  • timestamp: The date and time when the log message was created.
  • error: Optional. Any error object associated with the log message.
  • stackTrace: Optional. The stack trace associated with the log message, typically provided when logging errors.
  • context: Optional. Additional contextual information provided as a map, which can be useful for debugging.

Implementation

const LogMessage({
  required this.message,
  required this.level,
  required this.timestamp,
  this.error,
  this.stackTrace,
  this.context,
});