修复启动器未压缩日志的问题 (#3877)

This commit is contained in:
Glavo
2025-04-30 14:56:03 +08:00
committed by GitHub
parent 9a37d412a3
commit bfa9c1a697

View File

@@ -143,10 +143,7 @@ public final class Logger {
log(Level.WARNING, caller, "Failed to list log files in " + dir, e); log(Level.WARNING, caller, "Failed to list log files in " + dir, e);
} }
if (list.size() <= logRetention) { if (list.size() > logRetention) {
return;
}
list.sort((a, b) -> { list.sort((a, b) -> {
int[] v1 = a.getValue(); int[] v1 = a.getValue();
int[] v2 = b.getValue(); int[] v2 = b.getValue();
@@ -175,6 +172,7 @@ public final class Logger {
} }
} }
} }
}
ArrayList<LogEvent> logs = new ArrayList<>(); ArrayList<LogEvent> logs = new ArrayList<>();
queue.drainTo(logs); queue.drainTo(logs);