toJsonForProtocol method

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

Returns a JSON structure of the model, optimized for Protocol communication.

Implementation

@override
Map<String, dynamic> toJsonForProtocol() {
  return {
    if (id != null) 'id': id,
    'sessionLogId': sessionLogId,
    if (messageId != null) 'messageId': messageId,
    if (reference != null) 'reference': reference,
    'serverId': serverId,
    'time': time.toJson(),
    'logLevel': logLevel.toJson(),
    'message': message,
    if (error != null) 'error': error,
    if (stackTrace != null) 'stackTrace': stackTrace,
    'order': order,
  };
}