Files
MQTTnet/Tests/MQTTnet.Core.Tests/Mockups/TestLogger.cs
T
Christian 6bad9f183c Merge branch 'master' of https://github.com/chkr1011/MQTTnet into feature/Reason_Code_In_Subscription_Interceptor
# Conflicts:
#	Build/MQTTnet.nuspec
#	Source/MQTTnet/Server/Internal/MqttClientSessionsManager.cs
2021-10-29 21:58:57 +02:00

21 lines
666 B
C#

using System;
using MQTTnet.Diagnostics;
namespace MQTTnet.Tests.Mockups
{
public sealed class TestLogger : IMqttNetLogger
{
public event EventHandler<MqttNetLogMessagePublishedEventArgs> LogMessagePublished;
public void Publish(MqttNetLogLevel logLevel, string source, string message, object[] parameters, Exception exception)
{
LogMessagePublished?.Invoke(this, new MqttNetLogMessagePublishedEventArgs(new MqttNetLogMessage
{
Level = logLevel,
Message = string.Format(message, parameters),
Exception = exception
}));
}
}
}