@@ -10,7 +10,7 @@ namespace MQTTnet.Core.Packets | |||||
public override string ToString() | public override string ToString() | ||||
{ | { | ||||
return $"{nameof(MqttConnAckPacket)}: [ConnectReturnCode={ConnectReturnCode}] [IsSessionPresent={IsSessionPresent}]"; | |||||
return nameof(MqttConnAckPacket) + ": [ConnectReturnCode=" + ConnectReturnCode + "] [IsSessionPresent=" + IsSessionPresent + "]"; | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -2,7 +2,7 @@ | |||||
namespace MQTTnet.Core.Packets | namespace MQTTnet.Core.Packets | ||||
{ | { | ||||
public sealed class MqttConnectPacket: MqttBasePacket | |||||
public sealed class MqttConnectPacket : MqttBasePacket | |||||
{ | { | ||||
public MqttProtocolVersion ProtocolVersion { get; set; } | public MqttProtocolVersion ProtocolVersion { get; set; } | ||||
@@ -20,7 +20,7 @@ namespace MQTTnet.Core.Packets | |||||
public override string ToString() | public override string ToString() | ||||
{ | { | ||||
return $"{nameof(MqttConnectPacket)} [ClientId={ClientId}] [Username={Username}] [Password={Password}] [KeepAlivePeriod={KeepAlivePeriod}] [CleanSession={CleanSession}]"; | |||||
return nameof(MqttConnectPacket) + ": [ClientId=" + ClientId + "] [Username=" + Username + "] [Password=" + Password + "] [KeepAlivePeriod=" + KeepAlivePeriod + "] [CleanSession=" + CleanSession + "]"; | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -1,4 +1,4 @@ | |||||
using System.Text; | |||||
using System; | |||||
using MQTTnet.Core.Protocol; | using MQTTnet.Core.Protocol; | ||||
namespace MQTTnet.Core.Packets | namespace MQTTnet.Core.Packets | ||||
@@ -17,8 +17,13 @@ namespace MQTTnet.Core.Packets | |||||
public override string ToString() | public override string ToString() | ||||
{ | { | ||||
return | |||||
$"{nameof(MqttPublishPacket)} [Topic={Topic}] [Payload={Encoding.UTF8.GetString(Payload, 0, Payload.Length)}] [QoSLevel={QualityOfServiceLevel}] [Dup={Dup}] [Retain={Retain}] [PacketIdentifier={PacketIdentifier}]"; | |||||
return nameof(MqttPublishPacket) + | |||||
": [Topic=" + Topic + "]" + | |||||
" [Payload=" + Convert.ToBase64String(Payload) + "]" + | |||||
" [QoSLevel=" + QualityOfServiceLevel + "]" + | |||||
" [Dup=" + Dup + "]" + | |||||
" [Retain=" + Retain + "]" + | |||||
" [PacketIdentifier=" + PacketIdentifier + "]"; | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -13,8 +13,7 @@ namespace MQTTnet.Core.Packets | |||||
public override string ToString() | public override string ToString() | ||||
{ | { | ||||
var subscribeReturnCodesText = string.Join(",", SubscribeReturnCodes.Select(f => f.ToString())); | var subscribeReturnCodesText = string.Join(",", SubscribeReturnCodes.Select(f => f.ToString())); | ||||
return | |||||
$"{nameof(MqttSubAckPacket)} [PacketIdentifier={PacketIdentifier}] [SubscribeReturnCodes={subscribeReturnCodesText}]"; | |||||
return nameof(MqttSubAckPacket) + ": [PacketIdentifier=" + PacketIdentifier + "] [SubscribeReturnCodes=" + subscribeReturnCodesText + "]"; | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -12,8 +12,7 @@ namespace MQTTnet.Core.Packets | |||||
public override string ToString() | public override string ToString() | ||||
{ | { | ||||
var topicFiltersText = string.Join(",", TopicFilters.Select(f => $"{f.Topic}@{f.QualityOfServiceLevel}")); | var topicFiltersText = string.Join(",", TopicFilters.Select(f => $"{f.Topic}@{f.QualityOfServiceLevel}")); | ||||
return | |||||
$"{nameof(MqttSubscribePacket)} [PacketIdentifier={PacketIdentifier}] [TopicFilters={topicFiltersText}]"; | |||||
return nameof(MqttSubscribePacket) + ": [PacketIdentifier=" + PacketIdentifier + "] [TopicFilters=" + topicFiltersText + "]"; | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -76,7 +76,7 @@ namespace MQTTnet.Core.Server | |||||
_cancellationTokenSource.Cancel(); | _cancellationTokenSource.Cancel(); | ||||
Adapter = null; | Adapter = null; | ||||
MqttTrace.Information(nameof(MqttClientSession), $"Client '{_identifier}': Disconnected."); | |||||
MqttTrace.Information(nameof(MqttClientSession), "Client '{0}': Disconnected.", _identifier); | |||||
} | } | ||||
} | } | ||||