mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 18:11:27 -07:00
Reduce redundant logs when setting flags
This commit is contained in:
parent
d1861262fc
commit
6547118383
@ -110,13 +110,19 @@ namespace Bloxstrap
|
||||
{
|
||||
if (value is null)
|
||||
{
|
||||
Prop.Remove(key);
|
||||
if (Prop.ContainsKey(key))
|
||||
App.Logger.WriteLine($"[FastFlagManager::SetValue] Deletion of '{key}' is pending");
|
||||
|
||||
Prop.Remove(key);
|
||||
}
|
||||
else
|
||||
{
|
||||
Prop[key] = value.ToString()!;
|
||||
if (Prop.ContainsKey(key))
|
||||
App.Logger.WriteLine($"[FastFlagManager::SetValue] Setting of '{key}' from '{Prop[key]}' to '{value}' is pending");
|
||||
else
|
||||
App.Logger.WriteLine($"[FastFlagManager::SetValue] Setting of '{key}' to '{value}' is pending");
|
||||
|
||||
Prop[key] = value.ToString()!;
|
||||
}
|
||||
}
|
||||
|
||||
@ -157,13 +163,13 @@ namespace Bloxstrap
|
||||
|
||||
public string GetPresetEnum(IReadOnlyDictionary<string, string> mapping, string prefix, string value)
|
||||
{
|
||||
foreach (var mode in mapping)
|
||||
foreach (var pair in mapping)
|
||||
{
|
||||
if (mode.Key == mapping.First().Key)
|
||||
if (pair.Value == "None")
|
||||
continue;
|
||||
|
||||
if (App.FastFlags.GetPreset($"{prefix}.{mode.Value}") == value)
|
||||
return mode.Key;
|
||||
if (GetPreset($"{prefix}.{pair.Value}") == value)
|
||||
return pair.Key;
|
||||
}
|
||||
|
||||
return mapping.First().Key;
|
||||
|
Loading…
Reference in New Issue
Block a user