mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-28 06:46:24 +02: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:
parent
3fa714bb72
commit
732aafd3bb
2 changed files with 24 additions and 66 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue