Skip to content

Commit

Permalink
Log OpenRA and Operating System language on crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed Oct 23, 2022
1 parent c9fa988 commit e744706
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions OpenRA.Game/Support/ExceptionHandler.cs
Expand Up @@ -26,6 +26,9 @@ public static void HandleFatalError(Exception ex)
if (Game.EngineVersion != null)
Log.Write("exception", $"OpenRA engine version {Game.EngineVersion}");

if (Game.Settings != null && Game.Settings.Player != null && Game.Settings.Player.Language != null)
Log.Write("exception", $"OpenRA Language: {Game.Settings.Player.Language}");

if (Game.ModData != null)
{
var mod = Game.ModData.Manifest.Metadata;
Expand All @@ -41,6 +44,7 @@ public static void HandleFatalError(Exception ex)
Log.Write("exception", $"Date: {DateTime.UtcNow:u}");
Log.Write("exception", $"Operating System: {Platform.CurrentPlatform} ({Environment.OSVersion})");
Log.Write("exception", $"Runtime Version: {Platform.RuntimeVersion}", Platform.RuntimeVersion);
Log.Write("exception", $"System Language: {CultureInfo.InstalledUICulture} (Installed) {CultureInfo.CurrentCulture} (Current) {CultureInfo.CurrentUICulture} (Current UI)");
var rpt = BuildExceptionReport(ex).ToString();
Log.Write("exception", rpt);
Console.Error.WriteLine(rpt);
Expand Down

0 comments on commit e744706

Please sign in to comment.