From b09eb1213c699d00d15cd0fa7f8e3e03672a74f9 Mon Sep 17 00:00:00 2001 From: Christian Kratky Date: Sun, 8 Jul 2018 22:04:06 +0200 Subject: [PATCH] Refactor logging. --- Source/MQTTnet/Implementations/MqttTcpServerListener.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/MQTTnet/Implementations/MqttTcpServerListener.cs b/Source/MQTTnet/Implementations/MqttTcpServerListener.cs index 7f9ffbd..e352297 100644 --- a/Source/MQTTnet/Implementations/MqttTcpServerListener.cs +++ b/Source/MQTTnet/Implementations/MqttTcpServerListener.cs @@ -78,8 +78,10 @@ namespace MQTTnet.Implementations await sslStream.AuthenticateAsServerAsync(_tlsCertificate, false, SslProtocols.Tls12, false).ConfigureAwait(false); } - var protocol = _addressFamily == AddressFamily.InterNetwork ? "ipv4" : "ipv6"; - _logger.Verbose($"Client '{clientSocket.RemoteEndPoint}' accepted by TCP listener '{_socket.LocalEndPoint}, {protocol}'."); + _logger.Verbose("Client '{0}' accepted by TCP listener '{1}, {2}'.", + clientSocket.RemoteEndPoint, + _socket.LocalEndPoint, + _addressFamily == AddressFamily.InterNetwork ? "ipv4" : "ipv6"); var clientAdapter = new MqttChannelAdapter(new MqttTcpChannel(clientSocket, sslStream), new MqttPacketSerializer(), _logger); ClientAccepted?.Invoke(this, new MqttServerAdapterClientAcceptedEventArgs(clientAdapter));