aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormlgatto <98356234+mlgatto@users.noreply.github.com>2022-02-18 01:08:07 +0100
committerGitHub <noreply@github.com>2022-02-17 21:08:07 -0300
commit95cc18a7b41ca28f47b1388d1952e341fe568430 (patch)
tree86397c11eda2b696466c3b5d9f5edf7e91c6706a
parentc017c77365f877e2b4d2c4d15add6899c5d30fc4 (diff)
Added trace log level (#3096)1.1.38
* added trace log level * use trace log level instead of debug ( #1547) * alignment #1547 * moved trace logs toggle at the bottom #1547 * bumped config file version #3096 * added migration step #3096 * setting moved to the dev section #1547 * performance warning displayed when trace is enabled #1547
-rw-r--r--Ryujinx.Common/Logging/LogLevel.cs3
-rw-r--r--Ryujinx.Common/Logging/Logger.cs5
-rw-r--r--Ryujinx.Common/Logging/Targets/ConsoleLogTarget.cs1
-rw-r--r--Ryujinx.HLE/HOS/Kernel/SupervisorCall/SyscallTable.cs2
-rw-r--r--Ryujinx.HLE/HOS/Services/IpcService.cs2
-rw-r--r--Ryujinx.Headless.SDL2/Options.cs3
-rw-r--r--Ryujinx.Headless.SDL2/Program.cs1
-rw-r--r--Ryujinx/Configuration/ConfigurationFileFormat.cs7
-rw-r--r--Ryujinx/Configuration/ConfigurationState.cs18
-rw-r--r--Ryujinx/Configuration/LoggerModule.cs6
-rw-r--r--Ryujinx/Ui/MainWindow.cs8
-rw-r--r--Ryujinx/Ui/Windows/SettingsWindow.cs7
-rw-r--r--Ryujinx/Ui/Windows/SettingsWindow.glade18
13 files changed, 72 insertions, 9 deletions
diff --git a/Ryujinx.Common/Logging/LogLevel.cs b/Ryujinx.Common/Logging/LogLevel.cs
index b1c2d23b..8857fb45 100644
--- a/Ryujinx.Common/Logging/LogLevel.cs
+++ b/Ryujinx.Common/Logging/LogLevel.cs
@@ -9,6 +9,7 @@ namespace Ryujinx.Common.Logging
Error,
Guest,
AccessLog,
- Notice
+ Notice,
+ Trace
}
}
diff --git a/Ryujinx.Common/Logging/Logger.cs b/Ryujinx.Common/Logging/Logger.cs
index 040a555b..475e3628 100644
--- a/Ryujinx.Common/Logging/Logger.cs
+++ b/Ryujinx.Common/Logging/Logger.cs
@@ -90,6 +90,7 @@ namespace Ryujinx.Common.Logging
public static Log? Guest { get; private set; }
public static Log? AccessLog { get; private set; }
public static Log? Stub { get; private set; }
+ public static Log? Trace { get; private set; }
public static Log Notice { get; } // Always enabled
static Logger()
@@ -117,6 +118,7 @@ namespace Ryujinx.Common.Logging
Error = new Log(LogLevel.Error);
Warning = new Log(LogLevel.Warning);
Info = new Log(LogLevel.Info);
+ Trace = new Log(LogLevel.Trace);
}
public static void RestartTime()
@@ -172,7 +174,7 @@ namespace Ryujinx.Common.Logging
public static IReadOnlyCollection<LogLevel> GetEnabledLevels()
{
- var logs = new Log?[] { Debug, Info, Warning, Error, Guest, AccessLog, Stub };
+ var logs = new Log?[] { Debug, Info, Warning, Error, Guest, AccessLog, Stub, Trace };
List<LogLevel> levels = new List<LogLevel>(logs.Length);
foreach (var log in logs)
{
@@ -196,6 +198,7 @@ namespace Ryujinx.Common.Logging
case LogLevel.Guest : Guest = enabled ? new Log(LogLevel.Guest) : new Log?(); break;
case LogLevel.AccessLog : AccessLog = enabled ? new Log(LogLevel.AccessLog): new Log?(); break;
case LogLevel.Stub : Stub = enabled ? new Log(LogLevel.Stub) : new Log?(); break;
+ case LogLevel.Trace : Trace = enabled ? new Log(LogLevel.Trace) : new Log?(); break;
default: throw new ArgumentException("Unknown Log Level");
}
}
diff --git a/Ryujinx.Common/Logging/Targets/ConsoleLogTarget.cs b/Ryujinx.Common/Logging/Targets/ConsoleLogTarget.cs
index 15f0e153..54e9e85c 100644
--- a/Ryujinx.Common/Logging/Targets/ConsoleLogTarget.cs
+++ b/Ryujinx.Common/Logging/Targets/ConsoleLogTarget.cs
@@ -17,6 +17,7 @@ namespace Ryujinx.Common.Logging
LogLevel.Error => ConsoleColor.Red,
LogLevel.Stub => ConsoleColor.DarkGray,
LogLevel.Notice => ConsoleColor.Cyan,
+ LogLevel.Trace => ConsoleColor.DarkCyan,
_ => ConsoleColor.Gray,
};
diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SyscallTable.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SyscallTable.cs
index 91ab4d96..9f6b0a30 100644
--- a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SyscallTable.cs
+++ b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SyscallTable.cs
@@ -479,7 +479,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
}
else
{
- Logger.Debug?.Print(LogClass.KernelSvc, $"{svcName} returned result {result}.");
+ Logger.Trace?.Print(LogClass.KernelSvc, $"{svcName} returned result {result}.");
}
}
}
diff --git a/Ryujinx.HLE/HOS/Services/IpcService.cs b/Ryujinx.HLE/HOS/Services/IpcService.cs
index 108a4f70..526565a5 100644
--- a/Ryujinx.HLE/HOS/Services/IpcService.cs
+++ b/Ryujinx.HLE/HOS/Services/IpcService.cs
@@ -117,7 +117,7 @@ namespace Ryujinx.HLE.HOS.Services
if (serviceExists)
{
- Logger.Debug?.Print(LogClass.KernelIpc, $"{service.GetType().Name}: {processRequest.Name}");
+ Logger.Trace?.Print(LogClass.KernelIpc, $"{service.GetType().Name}: {processRequest.Name}");
result = (ResultCode)processRequest.Invoke(service, new object[] { context });
}
diff --git a/Ryujinx.Headless.SDL2/Options.cs b/Ryujinx.Headless.SDL2/Options.cs
index 2b52dfbe..4c9b83c4 100644
--- a/Ryujinx.Headless.SDL2/Options.cs
+++ b/Ryujinx.Headless.SDL2/Options.cs
@@ -135,6 +135,9 @@ namespace Ryujinx.Headless.SDL2
[Option("enable-error-logs", Required = false, Default = true, HelpText = "Enables printing error log messages.")]
public bool? LoggingEnableError { get; set; }
+ [Option("enable-trace-logs", Required = false, Default = false, HelpText = "Enables printing trace log messages.")]
+ public bool? LoggingEnableTrace { get; set; }
+
[Option("enable-guest-logs", Required = false, Default = true, HelpText = "Enables printing guest log messages.")]
public bool? LoggingEnableGuest { get; set; }
diff --git a/Ryujinx.Headless.SDL2/Program.cs b/Ryujinx.Headless.SDL2/Program.cs
index 14c72360..973b4f5e 100644
--- a/Ryujinx.Headless.SDL2/Program.cs
+++ b/Ryujinx.Headless.SDL2/Program.cs
@@ -389,6 +389,7 @@ namespace Ryujinx.Headless.SDL2
Logger.SetEnable(LogLevel.Info, (bool)option.LoggingEnableInfo);
Logger.SetEnable(LogLevel.Warning, (bool)option.LoggingEnableWarning);
Logger.SetEnable(LogLevel.Error, (bool)option.LoggingEnableError);
+ Logger.SetEnable(LogLevel.Trace, (bool)option.LoggingEnableTrace);
Logger.SetEnable(LogLevel.Guest, (bool)option.LoggingEnableGuest);
Logger.SetEnable(LogLevel.AccessLog, (bool)option.LoggingEnableFsAccessLog);
diff --git a/Ryujinx/Configuration/ConfigurationFileFormat.cs b/Ryujinx/Configuration/ConfigurationFileFormat.cs
index 9eb11a9e..8e64aa08 100644
--- a/Ryujinx/Configuration/ConfigurationFileFormat.cs
+++ b/Ryujinx/Configuration/ConfigurationFileFormat.cs
@@ -14,7 +14,7 @@ namespace Ryujinx.Configuration
/// <summary>
/// The current version of the file format
/// </summary>
- public const int CurrentVersion = 35;
+ public const int CurrentVersion = 36;
/// <summary>
/// Version of the configuration file format
@@ -82,6 +82,11 @@ namespace Ryujinx.Configuration
public bool LoggingEnableError { get; set; }
/// <summary>
+ /// Enables printing trace log messages
+ /// </summary>
+ public bool LoggingEnableTrace { get; set; }
+
+ /// <summary>
/// Enables printing guest log messages
/// </summary>
public bool LoggingEnableGuest { get; set; }
diff --git a/Ryujinx/Configuration/ConfigurationState.cs b/Ryujinx/Configuration/ConfigurationState.cs
index fdc28201..0b495ab7 100644
--- a/Ryujinx/Configuration/ConfigurationState.cs
+++ b/Ryujinx/Configuration/ConfigurationState.cs
@@ -130,6 +130,11 @@ namespace Ryujinx.Configuration
public ReactiveObject<bool> EnableError { get; private set; }
/// <summary>
+ /// Enables printing trace log messages
+ /// </summary>
+ public ReactiveObject<bool> EnableTrace { get; private set; }
+
+ /// <summary>
/// Enables printing guest log messages
/// </summary>
public ReactiveObject<bool> EnableGuest { get; private set; }
@@ -161,6 +166,7 @@ namespace Ryujinx.Configuration
EnableInfo = new ReactiveObject<bool>();
EnableWarn = new ReactiveObject<bool>();
EnableError = new ReactiveObject<bool>();
+ EnableTrace = new ReactiveObject<bool>();
EnableGuest = new ReactiveObject<bool>();
EnableFsAccessLog = new ReactiveObject<bool>();
FilteredClasses = new ReactiveObject<LogClass[]>();
@@ -455,6 +461,7 @@ namespace Ryujinx.Configuration
LoggingEnableInfo = Logger.EnableInfo,
LoggingEnableWarn = Logger.EnableWarn,
LoggingEnableError = Logger.EnableError,
+ LoggingEnableTrace = Logger.EnableTrace,
LoggingEnableGuest = Logger.EnableGuest,
LoggingEnableFsAccessLog = Logger.EnableFsAccessLog,
LoggingFilteredClasses = Logger.FilteredClasses,
@@ -526,6 +533,7 @@ namespace Ryujinx.Configuration
Logger.EnableInfo.Value = true;
Logger.EnableWarn.Value = true;
Logger.EnableError.Value = true;
+ Logger.EnableTrace.Value = false;
Logger.EnableGuest.Value = true;
Logger.EnableFsAccessLog.Value = false;
Logger.FilteredClasses.Value = Array.Empty<LogClass>();
@@ -990,6 +998,15 @@ namespace Ryujinx.Configuration
configurationFileUpdated = true;
}
+
+ if (configurationFileFormat.Version < 36)
+ {
+ Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 36.");
+
+ configurationFileFormat.LoggingEnableTrace = false;
+
+ configurationFileUpdated = true;
+ }
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
Graphics.BackendThreading.Value = configurationFileFormat.BackendThreading;
@@ -1003,6 +1020,7 @@ namespace Ryujinx.Configuration
Logger.EnableInfo.Value = configurationFileFormat.LoggingEnableInfo;
Logger.EnableWarn.Value = configurationFileFormat.LoggingEnableWarn;
Logger.EnableError.Value = configurationFileFormat.LoggingEnableError;
+ Logger.EnableTrace.Value = configurationFileFormat.LoggingEnableTrace;
Logger.EnableGuest.Value = configurationFileFormat.LoggingEnableGuest;
Logger.EnableFsAccessLog.Value = configurationFileFormat.LoggingEnableFsAccessLog;
Logger.FilteredClasses.Value = configurationFileFormat.LoggingFilteredClasses;
diff --git a/Ryujinx/Configuration/LoggerModule.cs b/Ryujinx/Configuration/LoggerModule.cs
index 2599eeff..9e81f725 100644
--- a/Ryujinx/Configuration/LoggerModule.cs
+++ b/Ryujinx/Configuration/LoggerModule.cs
@@ -13,6 +13,7 @@ namespace Ryujinx.Configuration
ConfigurationState.Instance.Logger.EnableInfo.Event += ReloadEnableInfo;
ConfigurationState.Instance.Logger.EnableWarn.Event += ReloadEnableWarning;
ConfigurationState.Instance.Logger.EnableError.Event += ReloadEnableError;
+ ConfigurationState.Instance.Logger.EnableTrace.Event += ReloadEnableTrace;
ConfigurationState.Instance.Logger.EnableGuest.Event += ReloadEnableGuest;
ConfigurationState.Instance.Logger.EnableFsAccessLog.Event += ReloadEnableFsAccessLog;
ConfigurationState.Instance.Logger.FilteredClasses.Event += ReloadFilteredClasses;
@@ -44,6 +45,11 @@ namespace Ryujinx.Configuration
Logger.SetEnable(LogLevel.Error, e.NewValue);
}
+ private static void ReloadEnableTrace(object sender, ReactiveEventArgs<bool> e)
+ {
+ Logger.SetEnable(LogLevel.Trace, e.NewValue);
+ }
+
private static void ReloadEnableGuest(object sender, ReactiveEventArgs<bool> e)
{
Logger.SetEnable(LogLevel.Guest, e.NewValue);
diff --git a/Ryujinx/Ui/MainWindow.cs b/Ryujinx/Ui/MainWindow.cs
index cc3c1239..92689307 100644
--- a/Ryujinx/Ui/MainWindow.cs
+++ b/Ryujinx/Ui/MainWindow.cs
@@ -638,18 +638,18 @@ namespace Ryujinx.Ui
[Conditional("RELEASE")]
public void PerformanceCheck()
{
- if (ConfigurationState.Instance.Logger.EnableDebug.Value)
+ if (ConfigurationState.Instance.Logger.EnableTrace.Value)
{
MessageDialog debugWarningDialog = new MessageDialog(this, DialogFlags.Modal, MessageType.Warning, ButtonsType.YesNo, null)
{
Title = "Ryujinx - Warning",
- Text = "You have debug logging enabled, which is designed to be used by developers only.",
- SecondaryText = "For optimal performance, it's recommended to disable debug logging. Would you like to disable debug logging now?"
+ Text = "You have trace logging enabled, which is designed to be used by developers only.",
+ SecondaryText = "For optimal performance, it's recommended to disable trace logging. Would you like to disable trace logging now?"
};
if (debugWarningDialog.Run() == (int)ResponseType.Yes)
{
- ConfigurationState.Instance.Logger.EnableDebug.Value = false;
+ ConfigurationState.Instance.Logger.EnableTrace.Value = false;
SaveConfig();
}
diff --git a/Ryujinx/Ui/Windows/SettingsWindow.cs b/Ryujinx/Ui/Windows/SettingsWindow.cs
index 8434d652..2b423081 100644
--- a/Ryujinx/Ui/Windows/SettingsWindow.cs
+++ b/Ryujinx/Ui/Windows/SettingsWindow.cs
@@ -35,6 +35,7 @@ namespace Ryujinx.Ui.Windows
private float _previousVolumeLevel;
#pragma warning disable CS0649, IDE0044
+ [GUI] CheckButton _traceLogToggle;
[GUI] CheckButton _errorLogToggle;
[GUI] CheckButton _warningLogToggle;
[GUI] CheckButton _infoLogToggle;
@@ -141,6 +142,11 @@ namespace Ryujinx.Ui.Windows
};
// Setup Currents.
+ if (ConfigurationState.Instance.Logger.EnableTrace)
+ {
+ _traceLogToggle.Click();
+ }
+
if (ConfigurationState.Instance.Logger.EnableFileLog)
{
_fileLogToggle.Click();
@@ -487,6 +493,7 @@ namespace Ryujinx.Ui.Windows
}
ConfigurationState.Instance.Logger.EnableError.Value = _errorLogToggle.Active;
+ ConfigurationState.Instance.Logger.EnableTrace.Value = _traceLogToggle.Active;
ConfigurationState.Instance.Logger.EnableWarn.Value = _warningLogToggle.Active;
ConfigurationState.Instance.Logger.EnableInfo.Value = _infoLogToggle.Active;
ConfigurationState.Instance.Logger.EnableStub.Value = _stubLogToggle.Active;
diff --git a/Ryujinx/Ui/Windows/SettingsWindow.glade b/Ryujinx/Ui/Windows/SettingsWindow.glade
index d9b36daf..c9d19a27 100644
--- a/Ryujinx/Ui/Windows/SettingsWindow.glade
+++ b/Ryujinx/Ui/Windows/SettingsWindow.glade
@@ -2572,6 +2572,24 @@
<property name="position">21</property>
</packing>
</child>
+ <child>
+ <object class="GtkCheckButton" id="_traceLogToggle">
+ <property name="label" translatable="yes">Enable Trace Logs</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">False</property>
+ <property name="tooltip-text" translatable="yes">Enables printing trace log messages</property>
+ <property name="halign">start</property>
+ <property name="margin-top">5</property>
+ <property name="margin-bottom">5</property>
+ <property name="draw-indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">22</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>