toJson method

  1. @override
Map<String, dynamic> toJson()
override

Converts the log entry to a JSON-serializable map.

The resulting map includes all fields from SimpleOverlayBaseLog plus the message, level, and a 'type' field set to 'simple' for identification.

Returns: A Map<String, dynamic> containing:

  • timestamp: ISO 8601 formatted timestamp
  • tag: The log category/component
  • message: The log message
  • level: The log level name ('debug', 'info', or 'error')
  • type: Always 'simple' to identify this log type

Implementation

@override
Map<String, dynamic> toJson() => {
      'timestamp': timestamp.toIso8601String(),
      'tag': tag,
      'message': message,
      'level': level.name,
      'type': 'simple',
    };