1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-14 05:07:26 +08:00

Merge pull request #19909 from peppy/framework-ini-in-sentry

Include framework configuration in sentry output
This commit is contained in:
Dean Herbert 2022-08-26 23:13:26 +09:00 committed by GitHub
commit 9c64520f8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 15 deletions

View File

@ -4,10 +4,8 @@
#nullable disable
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using osu.Framework.Configuration;
using osu.Framework.Configuration.Tracking;
using osu.Framework.Extensions;
@ -31,6 +29,12 @@ namespace osu.Game.Configuration
[ExcludeFromDynamicCompile]
public class OsuConfigManager : IniConfigManager<OsuSetting>
{
public OsuConfigManager(Storage storage)
: base(storage)
{
Migrate();
}
protected override void InitialiseDefaults()
{
// UI/selection defaults
@ -172,12 +176,9 @@ namespace osu.Game.Configuration
SetDefault(OsuSetting.LastProcessedMetadataId, -1);
}
public IDictionary<OsuSetting, string> GetLoggableState() =>
new Dictionary<OsuSetting, string>(ConfigStore.Where(kvp => !keyContainsPrivateInformation(kvp.Key)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToString()));
private static bool keyContainsPrivateInformation(OsuSetting argKey)
protected override bool CheckLookupContainsPrivateInformation(OsuSetting lookup)
{
switch (argKey)
switch (lookup)
{
case OsuSetting.Token:
return true;
@ -186,12 +187,6 @@ namespace osu.Game.Configuration
return false;
}
public OsuConfigManager(Storage storage)
: base(storage)
{
Migrate();
}
public void Migrate()
{
// arrives as 2020.123.0

View File

@ -9,6 +9,7 @@ using System.Net;
using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Configuration;
using osu.Framework.Logging;
using osu.Framework.Statistics;
using osu.Game.Beatmaps;
@ -112,8 +113,8 @@ namespace osu.Game.Utils
scope.Contexts[@"config"] = new
{
Game = game.Dependencies.Get<OsuConfigManager>().GetLoggableState()
// TODO: add framework config here. needs some consideration on how to expose.
Game = game.Dependencies.Get<OsuConfigManager>().GetCurrentConfigurationForLogging(),
Framework = game.Dependencies.Get<FrameworkConfigManager>().GetCurrentConfigurationForLogging(),
};
game.Dependencies.Get<RealmAccess>().Run(realm =>