GSF.TimeSeries.Transport.DataGapRecoverer.OnStatusMessage C# (CSharp) Method

OnStatusMessage() protected method

Raises the StatusMessage event and sends this data to the Logger.
should be a constant string value associated with what type of message is being generated. In general, there should only be a few dozen distinct event names per class. Exceeding this threshold will cause the EventName to be replaced with a general warning that a usage issue has occurred.
protected OnStatusMessage ( MessageLevel level, string status, string eventName = null, MessageFlags flags = MessageFlags.None ) : void
level MessageLevel The to assign to this message
status string New status message.
eventName string A fixed string to classify this event; defaults to null.
flags MessageFlags to use, if any; defaults to .
return void
        protected virtual void OnStatusMessage(MessageLevel level, string status, string eventName = null, MessageFlags flags = MessageFlags.None)
        {
            try
            {
                Log.Publish(level, flags, eventName ?? "DataGapRecovery", status);

                using (Logger.SuppressLogMessages())
                    StatusMessage?.Invoke(this, new EventArgs<string>(AdapterBase.GetStatusWithMessageLevelPrefix(status, level)));
            }
            catch (Exception ex)
            {
                // We protect our code from consumer thrown exceptions
                OnProcessException(MessageLevel.Info, new InvalidOperationException($"Exception in consumer handler for StatusMessage event: {ex.Message}", ex), "ConsumerEventException");
            }
        }