|
123456789101112131415161718 |
- using System;
-
- namespace MQTTnet.Diagnostics
- {
- public static class MqttNetGlobalLogger
- {
- public static event EventHandler<MqttNetLogMessagePublishedEventArgs> LogMessagePublished;
-
- public static bool HasListeners => LogMessagePublished != null;
-
- public static void Publish(MqttNetLogMessage logMessage)
- {
- if (logMessage == null) throw new ArgumentNullException(nameof(logMessage));
-
- LogMessagePublished?.Invoke(null, new MqttNetLogMessagePublishedEventArgs(logMessage));
- }
- }
- }
|