Skip to content

Commit

Permalink
Changed logging from error to trace/info.
Browse files Browse the repository at this point in the history
Fixed session logging category.
  • Loading branch information
DJGosnell committed Sep 18, 2023
1 parent b7fb8dc commit c74929f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/NexNet/Internals/NexusSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public NexusSession(in NexusSessionConfigurations<TNexus, TProxy> configurations
? new ServerSessionContext<TProxy>(this, _sessionManager!)
: new ClientSessionContext<TProxy>(this);

Logger = configurations.Configs.Logger?.CreateLogger($"NexusSession:", Id.ToString());
Logger = configurations.Configs.Logger?.CreateLogger($"NexusSession", Id.ToString());

PipeManager = _cacheManager.PipeManagerCache.Rent(this);
PipeManager.Setup(this);
Expand Down
7 changes: 3 additions & 4 deletions src/NexNet/Pipes/NexusPipeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public async ValueTask<INexusDuplexPipe> RegisterPipe(byte otherId)
// Signal that the pipe is ready to receive and send messages.
pipe.UpdateState(State.Ready);
await pipe.NotifyState().ConfigureAwait(false);
_logger?.LogError($"Sending Ready Notification");
_logger?.LogTrace($"Sending Ready Notification");
return pipe;
}

Expand Down Expand Up @@ -140,14 +140,14 @@ public ValueTask<NexusPipeBufferResult> BufferIncomingData(ushort id, ReadOnlySe
return pipe.WriteFromUpstream(data);
}

_logger?.LogError($"Received data on NexusDuplexPipe id: {id} but no stream is open on this id.");
_logger?.LogInfo($"Received data on NexusDuplexPipe id: {id} but no stream is open on this id.");
//throw new InvalidOperationException($"No pipe exists for id: {id}.");
return new ValueTask<NexusPipeBufferResult>(NexusPipeBufferResult.DataIgnored);
}

public DisconnectReason UpdateState(ushort id, NexusDuplexPipe.State state)
{
_logger?.LogError($"Pipe {id} update state {state}");
_logger?.LogTrace($"Pipe {id} update state {state}");
if (_isCanceled)
return DisconnectReason.None;

Expand All @@ -174,7 +174,6 @@ public DisconnectReason UpdateState(ushort id, NexusDuplexPipe.State state)
pipe.Id = id;

pipe.UpdateState(state);
_logger?.LogError($"Readies pipe {id}");
return DisconnectReason.None;
}
else if (state == State.Complete)
Expand Down

0 comments on commit c74929f

Please sign in to comment.