Improve logger performance.

This commit is contained in:
Christian Kratky
2020-05-12 21:55:15 +02:00
parent f0a1f9ca93
commit a58ab607ad
51 changed files with 290 additions and 300 deletions
+7 -22
View File
@@ -7,29 +7,9 @@ namespace MQTTnet.Tests.Mockups
{
public event EventHandler<MqttNetLogMessagePublishedEventArgs> LogMessagePublished;
public IMqttNetLogger CreateChildLogger(string source)
{
return new TestLogger();
}
public void Verbose(string message, params object[] parameters)
{
}
public void Info(string message, params object[] parameters)
{
}
public void Warning(Exception exception, string message, params object[] parameters)
{
}
public void Error(Exception exception, string message, params object[] parameters)
{
}
public void Publish(MqttNetLogLevel logLevel, string source, string message, object[] parameters, Exception exception)
public IMqttNetScopedLogger CreateScopedLogger(string source)
{
return new MqttNetScopedLogger(this, source);
}
public void Publish(MqttNetLogLevel logLevel, string message, object[] parameters, Exception exception)
@@ -40,5 +20,10 @@ namespace MQTTnet.Tests.Mockups
Message = message
}));
}
public void Publish(MqttNetLogLevel logLevel, string source, string message, object[] parameters, Exception exception)
{
throw new NotImplementedException();
}
}
}
@@ -1,19 +1,18 @@
using MQTTnet.Adapter;
using MQTTnet.Client.Options;
using MQTTnet.Diagnostics;
namespace MQTTnet.Tests.Mockups
{
public class TestMqttCommunicationAdapterFactory : IMqttClientAdapterFactory
{
private readonly IMqttChannelAdapter _adapter;
readonly IMqttChannelAdapter _adapter;
public TestMqttCommunicationAdapterFactory(IMqttChannelAdapter adapter)
{
_adapter = adapter;
}
public IMqttChannelAdapter CreateClientAdapter(IMqttClientOptions options, IMqttNetLogger logger)
public IMqttChannelAdapter CreateClientAdapter(IMqttClientOptions options)
{
return _adapter;
}