From 1998a3a90afeb5b1bede6ba0d17e7518a71cfe4f Mon Sep 17 00:00:00 2001
From: Mark Araujo <36304206+Pixxel123@users.noreply.github.com>
Date: Fri, 30 Apr 2021 20:39:42 +0100
Subject: [PATCH] Changes ordering of config.json and configuration files
(#2253)
This allows configuration values to be written to log file for analysis
---
Ryujinx.Common/Configuration/ConfigurationFileFormat.cs | 9 +++++----
Ryujinx.Common/Configuration/ConfigurationState.cs | 6 +++---
Ryujinx/Config.json | 2 +-
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs b/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs
index 1d47051a..092bb9dd 100644
--- a/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs
+++ b/Ryujinx.Common/Configuration/ConfigurationFileFormat.cs
@@ -18,6 +18,11 @@ namespace Ryujinx.Configuration
public int Version { get; set; }
+ ///
+ /// Enables or disables logging to a file on disk
+ ///
+ public bool EnableFileLog { get; set; }
+
///
/// Resolution Scale. An integer scale applied to applicable render targets. Values 1-4, or -1 to use a custom floating point scale instead.
///
@@ -88,10 +93,6 @@ namespace Ryujinx.Configuration
///
public GraphicsDebugLevel LoggingGraphicsDebugLevel { get; set; }
- ///
- /// Enables or disables logging to a file on disk
- ///
- public bool EnableFileLog { get; set; }
///
/// Change System Language
diff --git a/Ryujinx.Common/Configuration/ConfigurationState.cs b/Ryujinx.Common/Configuration/ConfigurationState.cs
index 7063110f..e65bcfcb 100644
--- a/Ryujinx.Common/Configuration/ConfigurationState.cs
+++ b/Ryujinx.Common/Configuration/ConfigurationState.cs
@@ -408,6 +408,7 @@ namespace Ryujinx.Configuration
ConfigurationFileFormat configurationFile = new ConfigurationFileFormat
{
Version = ConfigurationFileFormat.CurrentVersion,
+ EnableFileLog = Logger.EnableFileLog,
ResScale = Graphics.ResScale,
ResScaleCustom = Graphics.ResScaleCustom,
MaxAnisotropy = Graphics.MaxAnisotropy,
@@ -422,7 +423,6 @@ namespace Ryujinx.Configuration
LoggingEnableFsAccessLog = Logger.EnableFsAccessLog,
LoggingFilteredClasses = Logger.FilteredClasses,
LoggingGraphicsDebugLevel = Logger.GraphicsDebugLevel,
- EnableFileLog = Logger.EnableFileLog,
SystemLanguage = System.Language,
SystemRegion = System.Region,
SystemTimeZone = System.TimeZone,
@@ -474,6 +474,7 @@ namespace Ryujinx.Configuration
public void LoadDefault()
{
+ Logger.EnableFileLog.Value = true;
Graphics.ResScale.Value = 1;
Graphics.ResScaleCustom.Value = 1.0f;
Graphics.MaxAnisotropy.Value = -1.0f;
@@ -488,7 +489,6 @@ namespace Ryujinx.Configuration
Logger.EnableFsAccessLog.Value = false;
Logger.FilteredClasses.Value = Array.Empty();
Logger.GraphicsDebugLevel.Value = GraphicsDebugLevel.None;
- Logger.EnableFileLog.Value = true;
System.Language.Value = Language.AmericanEnglish;
System.Region.Value = Region.USA;
System.TimeZone.Value = "UTC";
@@ -803,6 +803,7 @@ namespace Ryujinx.Configuration
configurationFileUpdated = true;
}
+ Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
Graphics.ResScale.Value = configurationFileFormat.ResScale;
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
Graphics.MaxAnisotropy.Value = configurationFileFormat.MaxAnisotropy;
@@ -817,7 +818,6 @@ namespace Ryujinx.Configuration
Logger.EnableFsAccessLog.Value = configurationFileFormat.LoggingEnableFsAccessLog;
Logger.FilteredClasses.Value = configurationFileFormat.LoggingFilteredClasses;
Logger.GraphicsDebugLevel.Value = configurationFileFormat.LoggingGraphicsDebugLevel;
- Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
System.Language.Value = configurationFileFormat.SystemLanguage;
System.Region.Value = configurationFileFormat.SystemRegion;
System.TimeZone.Value = configurationFileFormat.SystemTimeZone;
diff --git a/Ryujinx/Config.json b/Ryujinx/Config.json
index 29460614..cf21656a 100644
--- a/Ryujinx/Config.json
+++ b/Ryujinx/Config.json
@@ -1,5 +1,6 @@
{
"version": 24,
+ "enable_file_log": true,
"res_scale": 1,
"res_scale_custom": 1,
"max_anisotropy": -1,
@@ -14,7 +15,6 @@
"logging_enable_fs_access_log": false,
"logging_filtered_classes": [],
"logging_graphics_debug_level": "None",
- "enable_file_log": true,
"system_language": "AmericanEnglish",
"system_region": "USA",
"system_time_zone": "UTC",