You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 lines
558 B

  1. using System;
  2. namespace MQTTnet.Core.Diagnostics
  3. {
  4. public static class MqttNetGlobalLog
  5. {
  6. public static event EventHandler<MqttNetLogMessagePublishedEventArgs> LogMessagePublished;
  7. public static bool HasListeners => LogMessagePublished != null;
  8. public static void Publish(MqttNetLogMessage logMessage)
  9. {
  10. if (logMessage == null) throw new ArgumentNullException(nameof(logMessage));
  11. LogMessagePublished?.Invoke(null, new MqttNetLogMessagePublishedEventArgs(logMessage));
  12. }
  13. }
  14. }