Ejemplo n.º 1
0
        public SentryLogger(OsuGame game)
        {
            this.game     = game;
            sentrySession = SentrySdk.Init(options =>
            {
                // Not setting the dsn will completely disable sentry.
                if (game.IsDeployedBuild && game.CreateEndpoints().WebsiteRootUrl.EndsWith(@".ppy.sh", StringComparison.Ordinal))
                {
                    options.Dsn = "https://[email protected]/2";
                }

                options.AutoSessionTracking = true;
                options.IsEnvironmentUser   = false;
                // The reported release needs to match version as reported to Sentry in .github/workflows/sentry-release.yml
                options.Release = $"osu@{game.Version.Replace($@"-{OsuGameBase.BUILD_SUFFIX}", string.Empty)}";
            });

            Logger.NewEntry += processLogEntry;
        }