Skip to content

Commit

Permalink
[dotnet] Make it easier to read bidi logs
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko committed Feb 1, 2025
1 parent 10a911f commit e2a2269
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public async Task<T> ReceiveAsJsonAsync<T>(JsonSerializerContext jsonSerializerC

if (_logger.IsEnabled(LogEventLevel.Trace))
{
_logger.Trace($"BiDi RCV << {Encoding.UTF8.GetString(ms.ToArray())}");
_logger.Trace($"BiDi RCV <-- {Encoding.UTF8.GetString(ms.ToArray())}");
}

var res = await JsonSerializer.DeserializeAsync(ms, typeof(T), jsonSerializerContext, cancellationToken).ConfigureAwait(false);
Expand All @@ -82,7 +82,7 @@ public async Task SendAsJsonAsync<TCommand>(TCommand command, JsonSerializerCont
{
if (_logger.IsEnabled(LogEventLevel.Trace))
{
_logger.Trace($"BiDi SND >> {Encoding.UTF8.GetString(buffer)}");
_logger.Trace($"BiDi SND --> {Encoding.UTF8.GetString(buffer)}");
}

await _webSocket.SendAsync(new ArraySegment<byte>(buffer), WebSocketMessageType.Text, true, cancellationToken).ConfigureAwait(false);
Expand Down

0 comments on commit e2a2269

Please sign in to comment.