Skip to content

Commit

Permalink
Add beatmap context to sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed May 11, 2022
1 parent b136677 commit 977a045
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions osu.Game/Utils/SentryLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Logging;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Overlays;
Expand Down Expand Up @@ -105,6 +106,15 @@ private void processLogEntry(LogEntry entry)
Game = game.Dependencies.Get<OsuConfigManager>().GetLoggableState()
// TODO: add framework config here. needs some consideration on how to expose.
};

var beatmap = game.Dependencies.Get<IBindable<WorkingBeatmap>>().Value.BeatmapInfo;

scope.Contexts[@"beatmap"] = new
{
Name = beatmap.ToString(),
beatmap.OnlineID,
};

scope.Contexts[@"clocks"] = new
{
Audio = game.Dependencies.Get<MusicController>().CurrentTrack.CurrentTime,
Expand Down

0 comments on commit 977a045

Please sign in to comment.