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 29, 2022
1 parent c9fa988 commit f0fe4e6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 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,8 @@ 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", $"Installed Language: {CultureInfo.InstalledUICulture.Name} (Installed) {CultureInfo.CurrentCulture.Name} (Current) {CultureInfo.CurrentUICulture.Name} (Current UI)");

var rpt = BuildExceptionReport(ex).ToString();
Log.Write("exception", rpt);
Console.Error.WriteLine(rpt);
Expand Down

0 comments on commit f0fe4e6

Please sign in to comment.