feat: enhance log filtering by adding support for debug level and updating log hierarchy #4293

This commit is contained in:
Tunglies
2025-08-06 20:49:54 +08:00
parent 7b976c16eb
commit a9cfb2cfaa
4 changed files with 36 additions and 11 deletions

View File

@@ -185,10 +185,7 @@ export const clearGlobalLogs = () => {
export const useGlobalLogData = (logLevel: LogLevel = "all") => {
const logs = useGlobalLogStore((state) => state.logs);
// 根据当前选择的日志等级过滤日志
if (logLevel === "all") {
return logs;
} else {
return logs.filter((log) => log.type.toLowerCase() === logLevel);
}
// 日志已经在后端根据级别进行了过滤,这里直接返回所有日志
// 不需要在前端再次过滤避免重复过滤导致DEBUG日志丢失
return logs;
};