InfospectLog constructor

InfospectLog({
  1. DiagnosticLevel level = DiagnosticLevel.info,
  2. DateTime? timestamp,
  3. required String message,
  4. dynamic error,
  5. StackTrace? stackTrace,
})

Creates an instance of the InfospectLog class.

Parameters:

  • level: The log level indicating the severity of the log (default is DiagnosticLevel.info).
  • timestamp: The timestamp when the log was created (default is the current time).
  • message: The log message.
  • error: The error associated with the log (optional).
  • stackTrace: The stack trace associated with the log (optional).

Implementation

InfospectLog({
  this.level = DiagnosticLevel.info,
  DateTime? timestamp,
  required this.message,
  this.error,
  this.stackTrace,
})  : assert(timestamp == null || !timestamp.isUtc),
      timestamp = timestamp ?? DateTime.now();