refactor: 替换服务端 console.log/error 为 winston logger
- folder-action.ts: 18处 console.log -> log.error - auth-action.ts: 4处 console.error -> log.error - dictionary-action/service.ts: 3处 -> log.error - translator-action/service.ts: 3处 -> log.error - bigmodel/translator/orchestrator.ts: console -> log.debug/info/error - bigmodel/tts.ts: console -> log.error/warn - bigmodel/dictionary/*.ts: console -> log.error/debug/info 客户端代码(browser、page.tsx)保留 console.error
This commit is contained in:
@@ -6,9 +6,12 @@ import {
|
||||
validateActionInputTranslateText,
|
||||
} from "./translator-action-dto";
|
||||
import { ValidateError } from "@/lib/errors";
|
||||
import { createLogger } from "@/lib/logger";
|
||||
import { serviceTranslateText } from "./translator-service";
|
||||
import { getAnswer } from "@/lib/bigmodel/zhipu";
|
||||
|
||||
const log = createLogger("translator-action");
|
||||
|
||||
export const actionTranslateText = async (
|
||||
dto: ActionInputTranslateText
|
||||
): Promise<ActionOutputTranslateText> => {
|
||||
@@ -25,7 +28,7 @@ export const actionTranslateText = async (
|
||||
message: e.message,
|
||||
};
|
||||
}
|
||||
console.log(e);
|
||||
log.error("Translation action failed", { error: e });
|
||||
return {
|
||||
success: false,
|
||||
message: "Unknown error occurred.",
|
||||
|
||||
Reference in New Issue
Block a user