Refactor FeatureFlags.

This commit is contained in:
Greyson Parrelli
2024-06-12 13:57:07 -04:00
parent 39cb1c638e
commit 13f7a64139
76 changed files with 1059 additions and 1053 deletions

View File

@@ -24,11 +24,9 @@ public class LogSectionFeatureFlags implements LogSection {
Map<String, Object> memory = FeatureFlags.getDebugMemoryValues();
Map<String, Object> disk = FeatureFlags.getDebugDiskValues();
Map<String, Object> pending = FeatureFlags.getDebugPendingDiskValues();
Map<String, Object> forced = FeatureFlags.getDebugForcedValues();
int remoteLength = Stream.of(memory.keySet()).map(String::length).max(Integer::compareTo).orElse(0);
int diskLength = Stream.of(disk.keySet()).map(String::length).max(Integer::compareTo).orElse(0);
int pendingLength = Stream.of(pending.keySet()).map(String::length).max(Integer::compareTo).orElse(0);
int forcedLength = Stream.of(forced.keySet()).map(String::length).max(Integer::compareTo).orElse(0);
out.append("-- Memory\n");
for (Map.Entry<String, Object> entry : memory.entrySet()) {
@@ -48,15 +46,6 @@ public class LogSectionFeatureFlags implements LogSection {
}
out.append("\n");
out.append("-- Forced\n");
if (forced.isEmpty()) {
out.append("None\n");
} else {
for (Map.Entry<String, Object> entry : forced.entrySet()) {
out.append(Util.rightPad(entry.getKey(), forcedLength)).append(": ").append(entry.getValue()).append("\n");
}
}
return out;
}
}