mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-02 02:00:01 +08:00
perf👌: 实现优化webui群组/好友管理api
This commit is contained in:
@@ -21,18 +21,6 @@ class LogStorage(Generic[_T]):
|
||||
self.listeners: Set[LogListener[str]] = set()
|
||||
|
||||
async def add(self, log: str):
|
||||
# log = re.sub(PATTERN, "", log)
|
||||
# log_split = log.split()
|
||||
# time = log_split[0] + " " + log_split[1]
|
||||
# level = log_split[2]
|
||||
# main = log_split[3]
|
||||
# type_ = None
|
||||
# log_ = " ".join(log_split[3:])
|
||||
# if "Calling API" in log_:
|
||||
# sp = log_.split("|")
|
||||
# type_ = sp[1]
|
||||
# log_ = "|".join(log_[1:])
|
||||
# data = {"time": time, "level": level, "main": main, "type": type_, "log": log_}
|
||||
seq = self.count = self.count + 1
|
||||
self.logs[seq] = log
|
||||
asyncio.get_running_loop().call_later(self.rotation, self.remove, seq)
|
||||
@@ -48,3 +36,4 @@ class LogStorage(Generic[_T]):
|
||||
|
||||
|
||||
LOG_STORAGE: LogStorage[str] = LogStorage[str]()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user