From 8c9edee360ba44364b5d3796f86e54db8bc04bf1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 16 May 2022 15:47:00 +0900 Subject: [PATCH 1/3] Add ruleset context to sentry error reports --- osu.Game/Utils/SentryLogger.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/osu.Game/Utils/SentryLogger.cs b/osu.Game/Utils/SentryLogger.cs index 3edb27ca9b..ace397708e 100644 --- a/osu.Game/Utils/SentryLogger.cs +++ b/osu.Game/Utils/SentryLogger.cs @@ -18,6 +18,7 @@ using osu.Game.Database; using osu.Game.Models; using osu.Game.Online.API.Requests.Responses; using osu.Game.Overlays; +using osu.Game.Rulesets; using osu.Game.Skinning; using Sentry; using Sentry.Protocol; @@ -109,6 +110,7 @@ namespace osu.Game.Utils }, scope => { var beatmap = game.Dependencies.Get>().Value.BeatmapInfo; + var ruleset = game.Dependencies.Get>().Value; scope.Contexts[@"config"] = new { @@ -137,9 +139,17 @@ namespace osu.Game.Utils scope.Contexts[@"beatmap"] = new { Name = beatmap.ToString(), + Ruleset = beatmap.Ruleset.InstantiationInfo, beatmap.OnlineID, }; + scope.Contexts[@"ruleset"] = new + { + ruleset.Name, + ruleset.InstantiationInfo, + ruleset.OnlineID + }; + scope.Contexts[@"clocks"] = new { Audio = game.Dependencies.Get().CurrentTrack.CurrentTime, From 5ec05a86535038c8dd2a79d1f34c30d24360ba02 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 16 May 2022 15:50:15 +0900 Subject: [PATCH 2/3] Add tags for current screen and ruleset --- osu.Game/OsuGame.cs | 2 ++ osu.Game/Utils/SentryLogger.cs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 3d56d33689..785881d97a 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -1207,6 +1207,8 @@ namespace osu.Game Current = newScreen?.GetType().ReadableName(), Previous = current?.GetType().ReadableName(), }; + + scope.SetTag(@"screen", newScreen?.GetType().ReadableName() ?? @"none"); }); switch (newScreen) diff --git a/osu.Game/Utils/SentryLogger.cs b/osu.Game/Utils/SentryLogger.cs index ace397708e..b5d318bc64 100644 --- a/osu.Game/Utils/SentryLogger.cs +++ b/osu.Game/Utils/SentryLogger.cs @@ -145,6 +145,7 @@ namespace osu.Game.Utils scope.Contexts[@"ruleset"] = new { + ruleset.ShortName, ruleset.Name, ruleset.InstantiationInfo, ruleset.OnlineID @@ -155,6 +156,8 @@ namespace osu.Game.Utils Audio = game.Dependencies.Get().CurrentTrack.CurrentTime, Game = game.Clock.CurrentTime, }; + + scope.SetTag(@"ruleset", ruleset.ShortName); }); } else From 9331c6230669ebccdd2a244f317299a5a647a3d4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 16 May 2022 16:07:56 +0900 Subject: [PATCH 3/3] Also add realm ruleset count --- osu.Game/Utils/SentryLogger.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Utils/SentryLogger.cs b/osu.Game/Utils/SentryLogger.cs index b5d318bc64..5390c666ed 100644 --- a/osu.Game/Utils/SentryLogger.cs +++ b/osu.Game/Utils/SentryLogger.cs @@ -127,6 +127,8 @@ namespace osu.Game.Utils BeatmapSets = realm.All().Count(), Beatmaps = realm.All().Count(), Files = realm.All().Count(), + Rulesets = realm.All().Count(), + RulesetsAvailable = realm.All().Count(r => r.Available), Skins = realm.All().Count(), } };