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); } }
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}"); } }