toJson method
Implementation
Map<String, Object?> toJson() => {
'channel': channel,
'title': _cap(withoutIdentityHash(title), _maxTitleChars),
'detail': ?(detail == null ? null : withoutIdentityHash(detail!)),
if (data.isNotEmpty) 'data': _capData(data),
if (body != null) 'body': _cap(withoutIdentityHash(body!), _maxBodyChars),
if (error) 'error': true,
'level': ?level,
'origin': ?origin,
};