This commit is contained in:
世界
2025-11-26 22:25:51 +08:00
parent 68b4142340
commit 2e2fc223bf
4 changed files with 146 additions and 31 deletions
+3 -2
View File
@@ -222,8 +222,9 @@ public class CommandClient: ObservableObject {
let logEntry = messageList.next()!
commandClient.logList.append(LogEntry(level: Int(logEntry.level), message: logEntry.message))
}
if commandClient.logList.count >= commandClient.logMaxLines {
commandClient.logList.removeSubrange(0 ... commandClient.logList.count - commandClient.logMaxLines)
if commandClient.logList.count > commandClient.logMaxLines {
let removeCount = commandClient.logList.count - commandClient.logMaxLines
commandClient.logList.removeFirst(removeCount)
}
}
}