Use different logger categories for client and server in McpJsonRpcEndpoint (#110)

* Use different logger categories for client and server in McpJsonRpcEndpoint

* Address PR feedback
This commit is contained in:
Stephen Halter 2025-03-26 19:18:16 -07:00 • committed by GitHub
commit 8be681543d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,7 +15,6 @@ namespace ModelContextProtocol.Client;
internal sealed class McpClient : McpJsonRpcEndpoint, IMcpClient
{
private readonly McpClientOptions _options;
private readonly ILogger _logger;
private readonly IClientTransport _clientTransport;
private volatile bool _isInitializing;
@ -31,7 +30,6 @@ internal sealed class McpClient : McpJsonRpcEndpoint, IMcpClient
: base(transport, loggerFactory)
{
_options = options;
_logger = (ILogger?)loggerFactory?.CreateLogger<McpClient>() ?? NullLogger.Instance;
_clientTransport = transport;
EndpointName = $"Client ({serverConfig.Id}: {serverConfig.Name})";