toJson method

Map<String, dynamic> toJson()

Serializes the event to a JSON map.

Implementation

Map<String, dynamic> toJson() {
  return {
    'eventId': eventId,
    'timestamp': timestamp.toIso8601String(),
    'level': level.toJson(),
    'exceptionType': exceptionType,
    'message': message,
    if (stackTrace != null) 'stackTrace': stackTrace,
    'fingerprint': fingerprint,
    if (fingerprintHash != null) 'fingerprintHash': fingerprintHash,
    'context': context,
    'breadcrumbs': breadcrumbs.map((b) => b.toJson()).toList(),
    'app': app,
    'runtime': runtime,
    'device': device,
  };
}