mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-30 18:56:30 +08:00
Improve logger performance.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user