Skip to content

Commit

Permalink
[dotnet] Kick off sending of request and log it in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko committed Jun 23, 2024
1 parent 4c00c23 commit aba09e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dotnet/src/webdriver/Remote/HttpCommandExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ public DiagnosticsHttpHandler(HttpMessageHandler messageHandler, ILogger logger)
/// <returns>The http response message content.</returns>
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
var responseTask = base.SendAsync(request, cancellationToken);

StringBuilder requestLogMessageBuilder = new();
requestLogMessageBuilder.AppendFormat(">> {0}", request);

Expand All @@ -423,11 +425,9 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
requestLogMessageBuilder.AppendFormat("{0}{1}", Environment.NewLine, requestContent);
}

var responseTask = base.SendAsync(request, cancellationToken).ConfigureAwait(false);

_logger.Trace(requestLogMessageBuilder.ToString());

var response = await responseTask;
var response = await responseTask.ConfigureAwait(false);

StringBuilder responseLogMessageBuilder = new();
responseLogMessageBuilder.AppendFormat("<< {0}", response);
Expand Down

0 comments on commit aba09e4

Please sign in to comment.