refactor(logging): centralize console output

This commit is contained in:
2026-06-18 13:34:19 +08:00
parent f600e11d55
commit 812a3e41b9
24 changed files with 261 additions and 166 deletions
+4 -1
View File
@@ -14,6 +14,9 @@ import { useEffect } from "react";
import Link from "next/link";
import { ROUTES } from "@/router/routes";
import { Logger } from "@/utils";
const log = new Logger("AppError");
interface ErrorProps {
error: Error & { digest?: string };
@@ -23,7 +26,7 @@ interface ErrorProps {
export default function GlobalError({ error, unstable_retry }: ErrorProps) {
useEffect(() => {
// 把错误送到 console;后续接 Sentry/Datadog 时改这里。
console.error("[app/error.tsx]", error);
log.error("[app/error.tsx]", error);
}, [error]);
return (