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:
2026-03-08 14:58:43 +08:00
parent 0881846717
commit c01c94abd0
13 changed files with 100 additions and 76 deletions

View File

@@ -2,8 +2,11 @@
import { ActionInputLookUpDictionary, ActionOutputLookUpDictionary, validateActionInputLookUpDictionary } from "./dictionary-action-dto";
import { ValidateError } from "@/lib/errors";
import { createLogger } from "@/lib/logger";
import { serviceLookUp } from "./dictionary-service";
const log = createLogger("dictionary-action");
export const actionLookUpDictionary = async (dto: ActionInputLookUpDictionary): Promise<ActionOutputLookUpDictionary> => {
try {
return {
@@ -18,7 +21,7 @@ export const actionLookUpDictionary = async (dto: ActionInputLookUpDictionary):
message: e.message
};
}
console.log(e);
log.error("Dictionary lookup failed", { error: e });
return {
success: false,
message: 'Unknown error occured.'