Skip to content

Commit

Permalink
Use trace logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Nytra committed Dec 24, 2024
1 parent dad3b75 commit 487d8a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions MonkeyLoader.Resonite.Integration/FieldExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public static Action<IChangeable> SyncWithNullableConfigKeyHasValue<T>(this IFie
IDefiningConfigKey<T?> configKey, string? eventLabel = null, bool allowWriteBack = true)
where T : struct
{
configKey.FindNearestParent<Mod>().Logger.Info(() => $"Syncing with nullable config key: {configKey.Id}");
configKey.FindNearestParent<Mod>().Logger.Trace(() => $"Syncing with nullable config key: {configKey.Id}");

field.Value = configKey.GetValue().HasValue;
eventLabel ??= field.GetWriteBackEventLabel();
Expand All @@ -132,7 +132,7 @@ public static Action<IChangeable> SyncWithNullableConfigKeyHasValue<T>(this IFie

void ParentDestroyedHandler(IDestroyable _)
{
configKey.FindNearestParent<Mod>().Logger.Info(() => $"Parent destroyed: {configKey.Id}");
configKey.FindNearestParent<Mod>().Logger.Trace(() => $"Parent destroyed: {configKey.Id}");

parent.Destroyed -= ParentDestroyedHandler;

Expand All @@ -142,7 +142,7 @@ void ParentDestroyedHandler(IDestroyable _)

void FieldChangedHandler(IChangeable _)
{
configKey.FindNearestParent<Mod>().Logger.Info(() => $"Field changed: {configKey.Id} {field.Value} {configKey.GetValue().HasValue} {allowWriteBack}");
configKey.FindNearestParent<Mod>().Logger.Trace(() => $"Field changed: {configKey.Id} {field.Value} {configKey.GetValue().HasValue} {allowWriteBack}");

T? newValue = field.Value ? default(T) : null;

Expand All @@ -152,7 +152,7 @@ void FieldChangedHandler(IChangeable _)

void ConfigKeyChangedHandler(object sender, ConfigKeyChangedEventArgs<T?> args)
{
configKey.FindNearestParent<Mod>().Logger.Info(() => $"Config key changed: {configKey.Id} {field.Value} {configKey.GetValue().HasValue}");
configKey.FindNearestParent<Mod>().Logger.Trace(() => $"Config key changed: {configKey.Id} {field.Value} {configKey.GetValue().HasValue}");

if (field.Value != configKey.GetValue().HasValue)
field.World.RunSynchronously(() => field.Value = configKey.GetValue().HasValue);
Expand Down

0 comments on commit 487d8a4

Please sign in to comment.