From f53d42d31ff51e6c43878e49f2db6b3da73a5841 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 11 May 2022 14:51:56 +0900 Subject: [PATCH] Add realm context to sentry --- osu.Game/Utils/SentryLogger.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/osu.Game/Utils/SentryLogger.cs b/osu.Game/Utils/SentryLogger.cs index d02ffcb013..a291cee9ae 100644 --- a/osu.Game/Utils/SentryLogger.cs +++ b/osu.Game/Utils/SentryLogger.cs @@ -6,14 +6,18 @@ using System; using System.Diagnostics; using System.IO; +using System.Linq; using System.Net; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Logging; using osu.Game.Beatmaps; using osu.Game.Configuration; +using osu.Game.Database; +using osu.Game.Models; using osu.Game.Online.API.Requests.Responses; using osu.Game.Overlays; +using osu.Game.Skinning; using Sentry; using Sentry.Protocol; @@ -101,13 +105,27 @@ namespace osu.Game.Utils Level = getSentryLevel(entry.Level), }, scope => { + var beatmap = game.Dependencies.Get>().Value.BeatmapInfo; + scope.Contexts[@"config"] = new { Game = game.Dependencies.Get().GetLoggableState() // TODO: add framework config here. needs some consideration on how to expose. }; - var beatmap = game.Dependencies.Get>().Value.BeatmapInfo; + game.Dependencies.Get().Run(realm => + { + scope.Contexts[@"realm"] = new + { + Counts = new + { + BeatmapSets = realm.All().Count(), + Beatmaps = realm.All().Count(), + Files = realm.All().Count(), + Skins = realm.All().Count(), + } + }; + }); scope.Contexts[@"beatmap"] = new {