toJson method

Map<String, dynamic> toJson()

Converts this breadcrumb to a map that can be serialized to JSON according to the Sentry protocol.

Implementation

Map<String, dynamic> toJson() {
  return {
    'timestamp': formatDateAsIso8601WithMillisPrecision(timestamp),
    if (message != null) 'message': message,
    if (category != null) 'category': category,
    if (data?.isNotEmpty ?? false) 'data': data,
    if (level != null) 'level': level!.name,
    if (type != null) 'type': type,
  };
}