mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 12:57:40 +00:00
refactor(agents): migrate console.warn/error/info to subsystem logger (#22906)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: a806c4cb27
Co-authored-by: Kepler2024 <166882517+Kepler2024@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import type { AssistantMessage } from "@mariozechner/pi-ai";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { createSubsystemLogger } from "../../logging/subsystem.js";
|
||||
import { formatSandboxToolPolicyBlockedMessage } from "../sandbox.js";
|
||||
import { stableStringify } from "../stable-stringify.js";
|
||||
import type { FailoverReason } from "./types.js";
|
||||
|
||||
const log = createSubsystemLogger("errors");
|
||||
|
||||
export function formatBillingErrorMessage(provider?: string, model?: string): string {
|
||||
const providerName = provider?.trim();
|
||||
const modelName = model?.trim();
|
||||
@@ -487,7 +490,7 @@ export function formatAssistantErrorText(
|
||||
|
||||
// Never return raw unhandled errors - log for debugging but return safe message
|
||||
if (raw.length > 600) {
|
||||
console.warn("[formatAssistantErrorText] Long error truncated:", raw.slice(0, 200));
|
||||
log.warn(`Long error truncated: ${raw.slice(0, 200)}`);
|
||||
}
|
||||
return raw.length > 600 ? `${raw.slice(0, 600)}…` : raw;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user