示例#1
0
        public ErrorReporter()
        {
            s_instance = this;
            _listener  = new CircularBufferTraceListener();
            Trace.Listeners.Clear();
            Trace.Listeners.Add(_listener);

            try
            {
                _bugsnagClient = new Client(Bugsnag.ConfigurationSection.Configuration.Settings);
                _bugsnagClient.BeforeNotify(new Middleware(OnBeforeNotify));
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex);
            }
        }
示例#2
0
        public ErrorReporter(AppSettings settings)
        {
            Debug.Assert(s_instance == null);
            s_instance = this;

            _listener = new CircularBufferTraceListener();
            _settings = settings;
            Trace.Listeners.Clear();
            Trace.Listeners.Add(_listener);

            if (_settings.IsTelemetryEnabled)
            {
                try
                {
                    _bugsnagClient = new Client(Bugsnag.ConfigurationSection.Configuration.Settings);
                    _bugsnagClient.BeforeNotify(new Middleware(OnBeforeNotify));
                }
                catch (Exception ex)
                {
                    Trace.WriteLine($"ErrorReporter .ctor Failed: {ex}");
                }
            }
        }