logNetworkRequest method

  1. @override
void logNetworkRequest({
  1. required String url,
  2. required HttpMethod method,
  3. required int startTime,
  4. required int endTime,
  5. required int bytesSent,
  6. required int bytesReceived,
  7. required int statusCode,
  8. String? error,
  9. String? traceId,
})
override

Log a network request.

Use the error parameter to pass the reason phrase or exception message for requests that are not successful.

Implementation

@override
void logNetworkRequest({
  required String url,
  required HttpMethod method,
  required int startTime,
  required int endTime,
  required int bytesSent,
  required int bytesReceived,
  required int statusCode,
  String? error,
  String? traceId,
}) {
  throwIfNotStarted();

  methodChannel.invokeMethod(_logNetworkRequestMethodName, {
    _urlArgName: url,
    _httpMethodArgName: method.toHttpString().toLowerCase(),
    _startTimeArgName: startTime,
    _endTimeArgName: endTime,
    _bytesSentArgName: bytesSent,
    _bytesReceivedArgName: bytesReceived,
    _statusCodeArgName: statusCode,
    _errorArgName: error,
    _traceIdArgName: traceId,
  });
}