mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-23 14:19:52 -06:00
misc: Prevent value change logging when the value is changed to the same thing it was before the value change.
This commit is contained in:
@ -53,6 +53,17 @@ namespace Ryujinx.Common
|
||||
{
|
||||
public static void LogValueChange<T>(LogClass logClass, ReactiveEventArgs<T> eventArgs, string valueName)
|
||||
{
|
||||
if ((eventArgs.NewValue == null || eventArgs.OldValue == null))
|
||||
{
|
||||
if (!(eventArgs.NewValue == null && eventArgs.OldValue == null))
|
||||
goto Log;
|
||||
}
|
||||
else if (!eventArgs.NewValue!.Equals(eventArgs.OldValue))
|
||||
goto Log;
|
||||
|
||||
return;
|
||||
|
||||
Log:
|
||||
string message = string.Create(CultureInfo.InvariantCulture, $"{valueName} set to: {eventArgs.NewValue}");
|
||||
|
||||
Logger.Info?.Print(logClass, message);
|
||||
|
Reference in New Issue
Block a user