mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-12-25 05:55:37 +00:00
Improves logging to console. (#2146)
* Restore removed text * Adds more items to logs: - Remove #1942 * Further removal of changes from #1942 * Removes hardcoded config state variables for logging - Adds Configuration logging * Decoupled logging from ReactiveObject - Event handler added to Configuration state to handle logging of value changes * Decoupled logging from ReactiveObject - Event handler added to Configuration state to handle logging of value changes
This commit is contained in:
parent
90163087a0
commit
faa654dbaf
|
@ -164,6 +164,7 @@ namespace Ryujinx.Configuration
|
||||||
EnableFsAccessLog = new ReactiveObject<bool>();
|
EnableFsAccessLog = new ReactiveObject<bool>();
|
||||||
FilteredClasses = new ReactiveObject<LogClass[]>();
|
FilteredClasses = new ReactiveObject<LogClass[]>();
|
||||||
EnableFileLog = new ReactiveObject<bool>();
|
EnableFileLog = new ReactiveObject<bool>();
|
||||||
|
EnableFileLog.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnableFileLog));
|
||||||
GraphicsDebugLevel = new ReactiveObject<GraphicsDebugLevel>();
|
GraphicsDebugLevel = new ReactiveObject<GraphicsDebugLevel>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,12 +236,19 @@ namespace Ryujinx.Configuration
|
||||||
TimeZone = new ReactiveObject<string>();
|
TimeZone = new ReactiveObject<string>();
|
||||||
SystemTimeOffset = new ReactiveObject<long>();
|
SystemTimeOffset = new ReactiveObject<long>();
|
||||||
EnableDockedMode = new ReactiveObject<bool>();
|
EnableDockedMode = new ReactiveObject<bool>();
|
||||||
|
EnableDockedMode.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnableDockedMode));
|
||||||
EnablePtc = new ReactiveObject<bool>();
|
EnablePtc = new ReactiveObject<bool>();
|
||||||
|
EnablePtc.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnablePtc));
|
||||||
EnableFsIntegrityChecks = new ReactiveObject<bool>();
|
EnableFsIntegrityChecks = new ReactiveObject<bool>();
|
||||||
|
EnableFsIntegrityChecks.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnableFsIntegrityChecks));
|
||||||
FsGlobalAccessLogMode = new ReactiveObject<int>();
|
FsGlobalAccessLogMode = new ReactiveObject<int>();
|
||||||
|
FsGlobalAccessLogMode.Event += static (sender, e) => LogValueChange(sender, e, nameof(FsGlobalAccessLogMode));
|
||||||
AudioBackend = new ReactiveObject<AudioBackend>();
|
AudioBackend = new ReactiveObject<AudioBackend>();
|
||||||
|
AudioBackend.Event += static (sender, e) => LogValueChange(sender, e, nameof(AudioBackend));
|
||||||
ExpandRam = new ReactiveObject<bool>();
|
ExpandRam = new ReactiveObject<bool>();
|
||||||
|
ExpandRam.Event += static (sender, e) => LogValueChange(sender, e, nameof(ExpandRam));
|
||||||
IgnoreMissingServices = new ReactiveObject<bool>();
|
IgnoreMissingServices = new ReactiveObject<bool>();
|
||||||
|
IgnoreMissingServices.Event += static (sender, e) => LogValueChange(sender, e, nameof(IgnoreMissingServices));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,12 +325,18 @@ namespace Ryujinx.Configuration
|
||||||
public GraphicsSection()
|
public GraphicsSection()
|
||||||
{
|
{
|
||||||
ResScale = new ReactiveObject<int>();
|
ResScale = new ReactiveObject<int>();
|
||||||
|
ResScale.Event += static (sender, e) => LogValueChange(sender, e, nameof(ResScale));
|
||||||
ResScaleCustom = new ReactiveObject<float>();
|
ResScaleCustom = new ReactiveObject<float>();
|
||||||
|
ResScaleCustom.Event += static (sender, e) => LogValueChange(sender, e, nameof(ResScaleCustom));
|
||||||
MaxAnisotropy = new ReactiveObject<float>();
|
MaxAnisotropy = new ReactiveObject<float>();
|
||||||
|
MaxAnisotropy.Event += static (sender, e) => LogValueChange(sender, e, nameof(MaxAnisotropy));
|
||||||
AspectRatio = new ReactiveObject<AspectRatio>();
|
AspectRatio = new ReactiveObject<AspectRatio>();
|
||||||
|
AspectRatio.Event += static (sender, e) => LogValueChange(sender, e, nameof(AspectRatio));
|
||||||
ShadersDumpPath = new ReactiveObject<string>();
|
ShadersDumpPath = new ReactiveObject<string>();
|
||||||
EnableVsync = new ReactiveObject<bool>();
|
EnableVsync = new ReactiveObject<bool>();
|
||||||
|
EnableVsync.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnableVsync));
|
||||||
EnableShaderCache = new ReactiveObject<bool>();
|
EnableShaderCache = new ReactiveObject<bool>();
|
||||||
|
EnableShaderCache.Event += static (sender, e) => LogValueChange(sender, e, nameof(EnableShaderCache));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -876,6 +890,11 @@ namespace Ryujinx.Configuration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void LogValueChange<T>(object sender, ReactiveEventArgs<T> eventArgs, string valueName)
|
||||||
|
{
|
||||||
|
Common.Logging.Logger.Info?.Print(LogClass.Configuration, $"{valueName} set to: {eventArgs.NewValue}");
|
||||||
|
}
|
||||||
|
|
||||||
public static void Initialize()
|
public static void Initialize()
|
||||||
{
|
{
|
||||||
if (Instance != null)
|
if (Instance != null)
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace Ryujinx.Common.Logging
|
||||||
Application,
|
Application,
|
||||||
Audio,
|
Audio,
|
||||||
AudioRenderer,
|
AudioRenderer,
|
||||||
|
Configuration,
|
||||||
Cpu,
|
Cpu,
|
||||||
Font,
|
Font,
|
||||||
Emulation,
|
Emulation,
|
||||||
|
|
|
@ -9,7 +9,6 @@ using Ryujinx.Audio.Output;
|
||||||
using Ryujinx.Audio.Renderer.Device;
|
using Ryujinx.Audio.Renderer.Device;
|
||||||
using Ryujinx.Audio.Renderer.Server;
|
using Ryujinx.Audio.Renderer.Server;
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Logging;
|
|
||||||
using Ryujinx.Configuration;
|
using Ryujinx.Configuration;
|
||||||
using Ryujinx.HLE.FileSystem.Content;
|
using Ryujinx.HLE.FileSystem.Content;
|
||||||
using Ryujinx.HLE.HOS.Font;
|
using Ryujinx.HLE.HOS.Font;
|
||||||
|
@ -328,8 +327,6 @@ namespace Ryujinx.HLE.HOS
|
||||||
|
|
||||||
// Reconfigure controllers
|
// Reconfigure controllers
|
||||||
Device.Hid.RefreshInputConfig(ConfigurationState.Instance.Hid.InputConfig.Value);
|
Device.Hid.RefreshInputConfig(ConfigurationState.Instance.Hid.InputConfig.Value);
|
||||||
|
|
||||||
Logger.Info?.Print(LogClass.Application, $"IsDocked toggled to: {State.DockedMode}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ using LibHac.FsSystem;
|
||||||
using Ryujinx.Audio.Backends.CompatLayer;
|
using Ryujinx.Audio.Backends.CompatLayer;
|
||||||
using Ryujinx.Audio.Integration;
|
using Ryujinx.Audio.Integration;
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Logging;
|
|
||||||
using Ryujinx.Configuration;
|
using Ryujinx.Configuration;
|
||||||
using Ryujinx.Graphics.GAL;
|
using Ryujinx.Graphics.GAL;
|
||||||
using Ryujinx.Graphics.Gpu;
|
using Ryujinx.Graphics.Gpu;
|
||||||
|
@ -154,11 +153,6 @@ namespace Ryujinx.HLE
|
||||||
// Configure controllers
|
// Configure controllers
|
||||||
Hid.RefreshInputConfig(ConfigurationState.Instance.Hid.InputConfig.Value);
|
Hid.RefreshInputConfig(ConfigurationState.Instance.Hid.InputConfig.Value);
|
||||||
ConfigurationState.Instance.Hid.InputConfig.Event += Hid.RefreshInputConfigEvent;
|
ConfigurationState.Instance.Hid.InputConfig.Event += Hid.RefreshInputConfigEvent;
|
||||||
|
|
||||||
Logger.Info?.Print(LogClass.Application, $"AudioBackend: {ConfigurationState.Instance.System.AudioBackend.Value}");
|
|
||||||
Logger.Info?.Print(LogClass.Application, $"IsDocked: {ConfigurationState.Instance.System.EnableDockedMode.Value}");
|
|
||||||
Logger.Info?.Print(LogClass.Application, $"Vsync: {ConfigurationState.Instance.Graphics.EnableVsync.Value}");
|
|
||||||
Logger.Info?.Print(LogClass.Application, $"MemoryConfiguration: {_memoryConfiguration}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IntegrityCheckLevel GetIntegrityCheckLevel()
|
public static IntegrityCheckLevel GetIntegrityCheckLevel()
|
||||||
|
|
|
@ -8,7 +8,6 @@ using OpenTK.Input;
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Configuration;
|
using Ryujinx.Common.Configuration;
|
||||||
using Ryujinx.Common.Configuration.Hid;
|
using Ryujinx.Common.Configuration.Hid;
|
||||||
using Ryujinx.Common.Logging;
|
|
||||||
using Ryujinx.Configuration;
|
using Ryujinx.Configuration;
|
||||||
using Ryujinx.Graphics.OpenGL;
|
using Ryujinx.Graphics.OpenGL;
|
||||||
using Ryujinx.HLE.HOS.Services.Hid;
|
using Ryujinx.HLE.HOS.Services.Hid;
|
||||||
|
@ -670,8 +669,6 @@ namespace Ryujinx.Ui
|
||||||
!_prevHotkeyButtons.HasFlag(HotkeyButtons.ToggleVSync))
|
!_prevHotkeyButtons.HasFlag(HotkeyButtons.ToggleVSync))
|
||||||
{
|
{
|
||||||
_device.EnableDeviceVsync = !_device.EnableDeviceVsync;
|
_device.EnableDeviceVsync = !_device.EnableDeviceVsync;
|
||||||
|
|
||||||
Logger.Info?.Print(LogClass.Application, $"Vsync toggled to: {_device.EnableDeviceVsync}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_prevHotkeyButtons = currentHotkeyButtons;
|
_prevHotkeyButtons = currentHotkeyButtons;
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
using Gtk;
|
using Gtk;
|
||||||
using Ryujinx.Audio;
|
|
||||||
using Ryujinx.Audio.Backends.OpenAL;
|
using Ryujinx.Audio.Backends.OpenAL;
|
||||||
using Ryujinx.Audio.Backends.SoundIo;
|
using Ryujinx.Audio.Backends.SoundIo;
|
||||||
using Ryujinx.Common.Configuration;
|
using Ryujinx.Common.Configuration;
|
||||||
using Ryujinx.Common.Configuration.Hid;
|
using Ryujinx.Common.Configuration.Hid;
|
||||||
using Ryujinx.Common.Logging;
|
|
||||||
using Ryujinx.Configuration;
|
using Ryujinx.Configuration;
|
||||||
using Ryujinx.Configuration.System;
|
using Ryujinx.Configuration.System;
|
||||||
using Ryujinx.HLE.FileSystem;
|
using Ryujinx.HLE.FileSystem;
|
||||||
|
@ -441,13 +439,7 @@ namespace Ryujinx.Ui.Windows
|
||||||
|
|
||||||
if (_audioBackendSelect.GetActiveIter(out TreeIter activeIter))
|
if (_audioBackendSelect.GetActiveIter(out TreeIter activeIter))
|
||||||
{
|
{
|
||||||
AudioBackend audioBackend = (AudioBackend)_audioBackendStore.GetValue(activeIter, 1);
|
ConfigurationState.Instance.System.AudioBackend.Value = (AudioBackend)_audioBackendStore.GetValue(activeIter, 1);
|
||||||
if (audioBackend != ConfigurationState.Instance.System.AudioBackend.Value)
|
|
||||||
{
|
|
||||||
ConfigurationState.Instance.System.AudioBackend.Value = audioBackend;
|
|
||||||
|
|
||||||
Logger.Info?.Print(LogClass.Application, $"AudioBackend toggled to: {audioBackend}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigurationState.Instance.ToFileFormat().SaveConfig(Program.ConfigurationPath);
|
ConfigurationState.Instance.ToFileFormat().SaveConfig(Program.ConfigurationPath);
|
||||||
|
|
Loading…
Reference in a new issue