add option in config
This commit is contained in:
parent
477dbebdc2
commit
f9b7230e36
5 changed files with 16 additions and 2 deletions
|
@ -16,6 +16,8 @@ namespace Ryujinx.Common.Logging
|
||||||
|
|
||||||
public static event EventHandler<LogEventArgs> Updated;
|
public static event EventHandler<LogEventArgs> Updated;
|
||||||
|
|
||||||
|
public static bool EnableFileLog { get; set; }
|
||||||
|
|
||||||
static Logger()
|
static Logger()
|
||||||
{
|
{
|
||||||
m_EnabledLevels = new bool[Enum.GetNames(typeof(LogLevel)).Length];
|
m_EnabledLevels = new bool[Enum.GetNames(typeof(LogLevel)).Length];
|
||||||
|
|
|
@ -62,6 +62,8 @@ namespace Ryujinx
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Logger.EnableFileLog = Convert.ToBoolean(parser.Value("Enable_File_Log"));
|
||||||
|
|
||||||
SystemLanguage SetLanguage = Enum.Parse<SystemLanguage>(parser.Value("System_Language"));
|
SystemLanguage SetLanguage = Enum.Parse<SystemLanguage>(parser.Value("System_Language"));
|
||||||
|
|
||||||
device.System.State.SetLanguage(SetLanguage);
|
device.System.State.SetLanguage(SetLanguage);
|
||||||
|
@ -118,7 +120,6 @@ namespace Ryujinx
|
||||||
});
|
});
|
||||||
|
|
||||||
NpadController = new NpadController(
|
NpadController = new NpadController(
|
||||||
|
|
||||||
Convert.ToBoolean(parser.Value("GamePad_Enable")),
|
Convert.ToBoolean(parser.Value("GamePad_Enable")),
|
||||||
Convert.ToInt32 (parser.Value("GamePad_Index")),
|
Convert.ToInt32 (parser.Value("GamePad_Index")),
|
||||||
(float)Convert.ToDouble (parser.Value("GamePad_Deadzone"), CultureInfo.InvariantCulture),
|
(float)Convert.ToDouble (parser.Value("GamePad_Deadzone"), CultureInfo.InvariantCulture),
|
||||||
|
|
|
@ -23,7 +23,9 @@ namespace Ryujinx
|
||||||
Config.Read(device);
|
Config.Read(device);
|
||||||
|
|
||||||
Logger.Updated += ConsoleLog.Log;
|
Logger.Updated += ConsoleLog.Log;
|
||||||
Logger.Updated += FileLog.Log;
|
|
||||||
|
if (Logger.EnableFileLog)
|
||||||
|
Logger.Updated += FileLog.Log;
|
||||||
|
|
||||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||||
AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
|
AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
|
||||||
|
|
|
@ -22,6 +22,9 @@ Logging_Enable_Error = true
|
||||||
#Filtered log classes, seperated by ", ", eg. `Logging_Filtered_Classes = Loader, ServiceFS`
|
#Filtered log classes, seperated by ", ", eg. `Logging_Filtered_Classes = Loader, ServiceFS`
|
||||||
Logging_Filtered_Classes =
|
Logging_Filtered_Classes =
|
||||||
|
|
||||||
|
#Enable file logging
|
||||||
|
Enable_File_Log = true
|
||||||
|
|
||||||
#System Language list: https://gist.github.com/HorrorTroll/b6e4a88d774c3c9b3bdf54d79a7ca43b
|
#System Language list: https://gist.github.com/HorrorTroll/b6e4a88d774c3c9b3bdf54d79a7ca43b
|
||||||
#Change System Language
|
#Change System Language
|
||||||
System_Language = AmericanEnglish
|
System_Language = AmericanEnglish
|
||||||
|
|
|
@ -20,6 +20,9 @@ namespace Ryujinx
|
||||||
|
|
||||||
static FileLog()
|
static FileLog()
|
||||||
{
|
{
|
||||||
|
if (!Logger.EnableFileLog)
|
||||||
|
return;
|
||||||
|
|
||||||
_path = Path.Combine(Environment.CurrentDirectory, "Ryujinx.log");
|
_path = Path.Combine(Environment.CurrentDirectory, "Ryujinx.log");
|
||||||
|
|
||||||
if (File.Exists(_path))
|
if (File.Exists(_path))
|
||||||
|
@ -98,6 +101,9 @@ namespace Ryujinx
|
||||||
|
|
||||||
public static void Close()
|
public static void Close()
|
||||||
{
|
{
|
||||||
|
if (!Logger.EnableFileLog)
|
||||||
|
return;
|
||||||
|
|
||||||
_messageQueue.CompleteAdding();
|
_messageQueue.CompleteAdding();
|
||||||
|
|
||||||
_messageThread.Join();
|
_messageThread.Join();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue