示例#1
0
 private static void OnNewLogItem(string text)
 {
     try // we don't want a faulty event handler to crash our log-thread
     {
         NewLogItem?.Invoke(text);
     }
     catch (Exception ex)
     {
         AddToEventLog(NAME, ex);
     }
 }
示例#2
0
        private void Add(MainLogItem logItem)
        {
            _queuedLogItemHandler.Add(logItem);

            try
            {
                NewLogItem?.Invoke(this, new MainLogItemEventArgs(logItem));
            }
            catch (Exception exception)
            {
                Debug.WriteLine($"EXCEPTION IN {nameof(MainLog)}: {exception}");
            }
        }