예제 #1
0
        public bool Trace(EventSeverity eventSeverity, string message, string codePoint = null, Dictionary <string, string> data = null, [CallerMemberName] string callerMemberName = "", [CallerFilePath] string callerFilePath = "", [CallerLineNumber] int callerLineNumber = -1)
        {
            try
            {
                DateTime eventTime = DateTime.UtcNow;

                ConsoleEvent evt = new ConsoleEvent()
                {
                    CallerFilePath     = callerFilePath,
                    CallerLineNumber   = callerLineNumber,
                    CallerMemberName   = callerMemberName,
                    CodePoint          = codePoint,
                    Data               = data,
                    EventSeverity      = eventSeverity,
                    EventTime          = eventTime,
                    Message            = message,
                    CorrelationContext = this.CorrelationContext.ToString()
                };

                this.eventQueue.Enqueue(evt);
                this.OnEventQueued(evt);



                return(true);
            }
            catch (Exception ex)
            {
                DiagnosticTrace.Instance.Error("An unexpected exception has occured when attemtping to enqueue a log event, the event has been lost. ", ex, "DSA7WAaQrUM");
                return(false);
            }
        }
예제 #2
0
 internal virtual void OnEventQueued(ConsoleEvent ce)
 {
     Diag($"EVENT QUEUED {ce.EventSeverity.ToString()}/{ce.Message}/{ce.CodePoint ?? "ncp"}");
 }