Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
chkr1011 committed Apr 22, 2019
1 parent 6399172 commit 2c927c5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 54 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ MQTTnet is a high performance .NET library for MQTT based communication. It prov
* Uniform API across all supported versions of the MQTT protocol
* Interfaces included for mocking and testing
* Access to internal trace messages
* Unit tested (~150 tests)
* Unit tested (~200 tests)
* No external dependencies

\* Tested on local machine (Intel i7 8700K) with MQTTnet client and server running in the same process using the TCP channel. The app for verification is part of this repository and stored in _/Tests/MQTTnet.TestApp.NetCore_.
Expand Down
51 changes: 0 additions & 51 deletions Source/MQTTnet.AspnetCore/TopicFilterBuilder.cs

This file was deleted.

12 changes: 10 additions & 2 deletions Source/MQTTnet.Server/Logging/MqttNetLoggerWrapper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Threading;
using Microsoft.Extensions.Logging;
using MQTTnet.Diagnostics;

Expand All @@ -14,7 +15,7 @@ public MqttNetLoggerWrapper(ILogger<MqttServer> logger)
}

public event EventHandler<MqttNetLogMessagePublishedEventArgs> LogMessagePublished;

public IMqttNetChildLogger CreateChildLogger(string source = null)
{
return new MqttNetChildLoggerWrapper(source, this);
Expand All @@ -24,8 +25,15 @@ public void Publish(MqttNetLogLevel logLevel, string source, string message, obj
{
var convertedLogLevel = ConvertLogLevel(logLevel);
_logger.Log(convertedLogLevel, exception, message, parameters);
}

var logMessagePublishedEvent = LogMessagePublished;
if (logMessagePublishedEvent != null)
{
var logMessage = new MqttNetLogMessage(null, DateTime.UtcNow, Thread.CurrentThread.ManagedThreadId, source, logLevel, message, exception);
logMessagePublishedEvent.Invoke(this, new MqttNetLogMessagePublishedEventArgs(logMessage));
}
}

private static LogLevel ConvertLogLevel(MqttNetLogLevel logLevel)
{
switch (logLevel)
Expand Down

0 comments on commit 2c927c5

Please sign in to comment.