GSF.Diagnostics.LogPublisher.Publish C# (CSharp) Method

Publish() public method

Raises a log message with the provided data.
public Publish ( MessageLevel level, MessageFlags flags, string eventName, string message = null, string details = null, Exception exception = null ) : void
level MessageLevel the level of the message
flags MessageFlags associated flags
eventName string A short name about what this message is detailing. Typically this will be a few words.
message string A longer message than giving more specifics about the actual message. /// Typically, this will be up to 1 line of text.
details string A long text field with the details of the message.
exception System.Exception An exception object if one is provided.
return void
        public void Publish(MessageLevel level, MessageFlags flags, string eventName, string message = null, string details = null, Exception exception = null)
        {
            LogMessageAttributes flag = new LogMessageAttributes(m_classification, level, MessageSuppression.None, flags);
            InternalRegisterEvent(flag, eventName).Publish(null, message, details, exception, InitialStackMessages, InitialStackTrace);
        }

Same methods

LogPublisher::Publish ( MessageLevel level, string eventName, string message = null, string details = null, Exception exception = null ) : void

Usage Example

Example #1
0
        static ThreadPoolTrace()
        {
            WorksInThisRuntime = false;

            try
            {
                s_threadPoolType = typeof(ThreadPool);
                s_threadPoolGetQueuedWorkItemsMethod = s_threadPoolType.GetMethod("GetQueuedWorkItems", BindingFlags.Static | BindingFlags.NonPublic);

                s_queueWorkerCallbackType = Type.GetType("System.Threading.QueueUserWorkItemCallback");
                s_callbackField           = s_queueWorkerCallbackType?.GetField("callback", BindingFlags.NonPublic | BindingFlags.Instance);
                s_stateField          = s_queueWorkerCallbackType?.GetField("state", BindingFlags.NonPublic | BindingFlags.Instance);
                s_timerQueueTimerType = Type.GetType("System.Threading.TimerQueueTimer");
                s_timerQueueTimerTimerCallbackField = s_timerQueueTimerType?.GetField("m_timerCallback", BindingFlags.NonPublic | BindingFlags.Instance);
                s_timerQueueType = Type.GetType("System.Threading.TimerQueue");
                s_timerQueueFireQueuedTimerCompletionMethod = s_timerQueueType?.GetMethod("FireQueuedTimerCompletion", BindingFlags.NonPublic | BindingFlags.Static);
                s_timerType = typeof(System.Timers.Timer);
                s_timerOnIntervalElapsedField = s_timerType?.GetField("onIntervalElapsed", BindingFlags.NonPublic | BindingFlags.Instance);
                WorksInThisRuntime            = true;
            }
            catch (Exception ex)
            {
                Log.Publish(MessageLevel.Error, MessageFlags.BugReport, "Error in constructor", null, null, ex);
            }
        }
All Usage Examples Of GSF.Diagnostics.LogPublisher::Publish