mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01: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)
|
if (value is null)
|
||||||
{
|
{
|
||||||
|
if (Prop.ContainsKey(key))
|
||||||
|
App.Logger.WriteLine($"[FastFlagManager::SetValue] Deletion of '{key}' is pending");
|
||||||
|
|
||||||
Prop.Remove(key);
|
Prop.Remove(key);
|
||||||
App.Logger.WriteLine($"[FastFlagManager::SetValue] Deletion of '{key}' is pending");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
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()!;
|
Prop[key] = value.ToString()!;
|
||||||
App.Logger.WriteLine($"[FastFlagManager::SetValue] Setting of '{key}' to '{value}' is pending");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,13 +163,13 @@ namespace Bloxstrap
|
|||||||
|
|
||||||
public string GetPresetEnum(IReadOnlyDictionary<string, string> mapping, string prefix, string value)
|
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;
|
continue;
|
||||||
|
|
||||||
if (App.FastFlags.GetPreset($"{prefix}.{mode.Value}") == value)
|
if (GetPreset($"{prefix}.{pair.Value}") == value)
|
||||||
return mode.Key;
|
return pair.Key;
|
||||||
}
|
}
|
||||||
|
|
||||||
return mapping.First().Key;
|
return mapping.First().Key;
|
||||||
|
Loading…
Reference in New Issue
Block a user