mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 11:45:43 +08:00
Align different formats of log messages.
This commit is contained in:
@@ -453,7 +453,7 @@ namespace MQTTnet.Server
|
||||
}
|
||||
}
|
||||
|
||||
_logger.Verbose("Queued application message sent (ClientId: {0}).", ClientId);
|
||||
_logger.Verbose("Client '{0}': Queued application message sent.", ClientId);
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
@@ -463,15 +463,15 @@ namespace MQTTnet.Server
|
||||
}
|
||||
else if (exception is MqttCommunicationTimedOutException)
|
||||
{
|
||||
_logger.Warning(exception, "Sending publish packet failed: Timeout (ClientId: {0}).", ClientId);
|
||||
_logger.Warning(exception, "Client '{0}': Sending publish packet failed: Timeout.", ClientId);
|
||||
}
|
||||
else if (exception is MqttCommunicationException)
|
||||
{
|
||||
_logger.Warning(exception, "Sending publish packet failed: Communication exception (ClientId: {0}).", ClientId);
|
||||
_logger.Warning(exception, "Client '{0}': Sending publish packet failed: Communication exception.", ClientId);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Error(exception, "Sending publish packet failed (ClientId: {0}).", ClientId);
|
||||
_logger.Error(exception, "Client '{0}': Sending publish packet failed.", ClientId);
|
||||
}
|
||||
|
||||
if (publishPacket?.QualityOfServiceLevel > MqttQualityOfServiceLevel.AtMostOnce)
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace MQTTnet.Server
|
||||
return false;
|
||||
}
|
||||
|
||||
_logger.Verbose("Queued application message with topic '{0}' (ClientId: {1}).", applicationMessage.Topic, ClientId);
|
||||
_logger.Verbose("Client '{0}': Queued application message with topic '{1}'.", ClientId, applicationMessage.Topic);
|
||||
|
||||
ApplicationMessagesQueue.Enqueue(applicationMessage, senderClientId, checkSubscriptionsResult.QualityOfServiceLevel, isRetainedApplicationMessage);
|
||||
|
||||
|
||||
@@ -67,20 +67,21 @@ namespace MQTTnet.Server
|
||||
if (connectPacket == null)
|
||||
{
|
||||
_logger.Warning(null,
|
||||
"The first packet from client '{0}' was no 'CONNECT' packet [MQTT-3.1.0-1].",
|
||||
"Client '{0}': First received packet was no 'CONNECT' packet [MQTT-3.1.0-1].",
|
||||
channelAdapter.Endpoint);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
_logger.Warning(null, "Client '{0}' connected but did not sent a CONNECT packet.", channelAdapter.Endpoint);
|
||||
_logger.Warning(null, "Client '{0}': Connected but did not sent a CONNECT packet.", channelAdapter.Endpoint);
|
||||
return;
|
||||
}
|
||||
catch (MqttCommunicationTimedOutException)
|
||||
{
|
||||
_logger.Warning(null, "Client '{0}' connected but did not sent a CONNECT packet.", channelAdapter.Endpoint);
|
||||
_logger.Warning(null, "Client '{0}': Connected but did not sent a CONNECT packet.", channelAdapter.Endpoint);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user