Esempio n. 1
0
        public SentryTarget(string dsn)
        {
            _sdk = SentrySdk.Init(o =>
            {
                o.Dsn = new Dsn(dsn);
                o.AttachStacktrace = true;
                o.MaxBreadcrumbs   = 200;
                o.SendDefaultPii   = false;
                o.AttachStacktrace = true;
                o.Debug            = false;
                o.DiagnosticsLevel = SentryLevel.Debug;
                o.Release          = BuildInfo.Release;
                if (PlatformInfo.IsMono)
                {
                    // Mono 6.0 broke GzipStream.WriteAsync
                    // TODO: Check specific version
                    o.RequestBodyCompressionLevel = System.IO.Compression.CompressionLevel.NoCompression;
                }
                o.BeforeSend       = x => SentryCleanser.CleanseEvent(x);
                o.BeforeBreadcrumb = x => SentryCleanser.CleanseBreadcrumb(x);
                o.Environment      = BuildInfo.Branch;
            });

            InitializeScope();

            _debounce = new SentryDebounce();

            // initialize to true and reconfigure later
            // Otherwise it will default to false and any errors occuring
            // before config file gets read will not be filtered
            FilterEvents = true;

            SentryEnabled = true;
        }
Esempio n. 2
0
        public SentryTarget(string dsn)
        {
            _sdk = SentrySdk.Init(o =>
            {
                o.Dsn = dsn;
                o.AttachStacktrace = true;
                o.MaxBreadcrumbs   = 200;
                o.SendDefaultPii   = false;
                o.Debug            = false;
                o.DiagnosticLevel  = SentryLevel.Debug;
                o.Release          = BuildInfo.Release;
                o.BeforeSend       = x => SentryCleanser.CleanseEvent(x);
                o.BeforeBreadcrumb = x => SentryCleanser.CleanseBreadcrumb(x);
                o.Environment      = BuildInfo.Branch;
            });

            InitializeScope();

            _debounce = new SentryDebounce();

            // initialize to true and reconfigure later
            // Otherwise it will default to false and any errors occuring
            // before config file gets read will not be filtered
            FilterEvents  = true;
            SentryEnabled = true;
        }