Revert "feat: enhance log filtering by adding support for debug level and updating log hierarchy #4293"
This reverts commit a9cfb2cfaa.
This commit is contained in:
@@ -29,9 +29,6 @@ const Item = styled(Box)(({ theme: { palette, typography } }) => ({
|
||||
'& .type[data-type="info"], & .type[data-type="inf"]': {
|
||||
color: palette.info.main,
|
||||
},
|
||||
'& .type[data-type="debug"], & .type[data-type="dbg"]': {
|
||||
color: palette.text.secondary,
|
||||
},
|
||||
"& .data": {
|
||||
color: palette.text.primary,
|
||||
overflowWrap: "anywhere",
|
||||
|
||||
@@ -30,7 +30,7 @@ const LOG_LEVEL_HIERARCHY = {
|
||||
info: ["info", "warning", "error"],
|
||||
warning: ["warning", "error"],
|
||||
error: ["error"],
|
||||
debug: ["info", "warning", "error", "debug"],
|
||||
debug: ["debug"],
|
||||
};
|
||||
|
||||
const LogPage = () => {
|
||||
|
||||
@@ -185,7 +185,10 @@ export const clearGlobalLogs = () => {
|
||||
export const useGlobalLogData = (logLevel: LogLevel = "all") => {
|
||||
const logs = useGlobalLogStore((state) => state.logs);
|
||||
|
||||
// 日志已经在后端根据级别进行了过滤,这里直接返回所有日志
|
||||
// 不需要在前端再次过滤,避免重复过滤导致DEBUG日志丢失
|
||||
return logs;
|
||||
// 根据当前选择的日志等级过滤日志
|
||||
if (logLevel === "all") {
|
||||
return logs;
|
||||
} else {
|
||||
return logs.filter((log) => log.type.toLowerCase() === logLevel);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user