diff --git a/Ryujinx.Common/Logging/Logger.cs b/Ryujinx.Common/Logging/Logger.cs index 5e58f8064c..35ca416bc9 100644 --- a/Ryujinx.Common/Logging/Logger.cs +++ b/Ryujinx.Common/Logging/Logger.cs @@ -16,6 +16,8 @@ namespace Ryujinx.Common.Logging public static event EventHandler Updated; + public static bool EnableFileLog { get; set; } + static Logger() { m_EnabledLevels = new bool[Enum.GetNames(typeof(LogLevel)).Length]; diff --git a/Ryujinx/Config.cs b/Ryujinx/Config.cs index d1139da924..a1d8cddf4d 100644 --- a/Ryujinx/Config.cs +++ b/Ryujinx/Config.cs @@ -62,6 +62,8 @@ namespace Ryujinx } } + Logger.EnableFileLog = Convert.ToBoolean(parser.Value("Enable_File_Log")); + SystemLanguage SetLanguage = Enum.Parse(parser.Value("System_Language")); device.System.State.SetLanguage(SetLanguage); @@ -118,7 +120,6 @@ namespace Ryujinx }); NpadController = new NpadController( - Convert.ToBoolean(parser.Value("GamePad_Enable")), Convert.ToInt32 (parser.Value("GamePad_Index")), (float)Convert.ToDouble (parser.Value("GamePad_Deadzone"), CultureInfo.InvariantCulture), diff --git a/Ryujinx/Program.cs b/Ryujinx/Program.cs index 9fe7124e74..dcedc66a5c 100644 --- a/Ryujinx/Program.cs +++ b/Ryujinx/Program.cs @@ -23,7 +23,9 @@ namespace Ryujinx Config.Read(device); Logger.Updated += ConsoleLog.Log; - Logger.Updated += FileLog.Log; + + if (Logger.EnableFileLog) + Logger.Updated += FileLog.Log; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit; diff --git a/Ryujinx/Ryujinx.conf b/Ryujinx/Ryujinx.conf index c04d7b5ac9..6edcb8e67e 100644 --- a/Ryujinx/Ryujinx.conf +++ b/Ryujinx/Ryujinx.conf @@ -22,6 +22,9 @@ Logging_Enable_Error = true #Filtered log classes, seperated by ", ", eg. `Logging_Filtered_Classes = Loader, ServiceFS` Logging_Filtered_Classes = +#Enable file logging +Enable_File_Log = true + #System Language list: https://gist.github.com/HorrorTroll/b6e4a88d774c3c9b3bdf54d79a7ca43b #Change System Language System_Language = AmericanEnglish diff --git a/Ryujinx/Ui/FileLog.cs b/Ryujinx/Ui/FileLog.cs index 10872fea8a..97cdfe54ba 100644 --- a/Ryujinx/Ui/FileLog.cs +++ b/Ryujinx/Ui/FileLog.cs @@ -20,6 +20,9 @@ namespace Ryujinx static FileLog() { + if (!Logger.EnableFileLog) + return; + _path = Path.Combine(Environment.CurrentDirectory, "Ryujinx.log"); if (File.Exists(_path)) @@ -98,6 +101,9 @@ namespace Ryujinx public static void Close() { + if (!Logger.EnableFileLog) + return; + _messageQueue.CompleteAdding(); _messageThread.Join();