/// <summary> /// Publishes a message and exception with a given log level to the EventHub /// </summary> /// <param name="message">Message to be communicated to the integrator</param> /// <param name="logLevel">The log level which determines the event that is fired of (OnDebug, OnWarn, etc.)</param> /// <param name="ex">The exception to be published</param> private static void Publish(string message, Exception ex, LogLevelType logLevel) { if (EventHub.IsListening(logLevel)) { EventHub.RaiseException(new LogEventArgs(message, ex, logLevel)); } }
/// <summary> /// Returns true if an event is wired up the specified log level /// </summary> /// <param name="logLevel">Typically used to route to specific events in the EventHub, such as OnError, OnFatal, etc.</param> /// <returns></returns> public static bool IsListening(LogLevelType logLevel) { return(EventHub.IsListening(logLevel)); }