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:
Harry Cui Kepler
2026-02-21 23:11:47 +01:00
committed by GitHub
parent 1257aee6e1
commit ffa63173e0
16 changed files with 79 additions and 50 deletions

View File

@@ -1,7 +1,10 @@
import { type OpenClawConfig, loadConfig } from "../config/config.js";
import { createSubsystemLogger } from "../logging/subsystem.js";
import { resolveOpenClawAgentDir } from "./agent-paths.js";
import { ensureOpenClawModelsJson } from "./models-config.js";
const log = createSubsystemLogger("model-catalog");
export type ModelCatalogEntry = {
id: string;
name: string;
@@ -150,7 +153,7 @@ export async function loadModelCatalog(params?: {
} catch (error) {
if (!hasLoggedModelCatalogError) {
hasLoggedModelCatalogError = true;
console.warn(`[model-catalog] Failed to load model catalog: ${String(error)}`);
log.warn(`Failed to load model catalog: ${String(error)}`);
}
// Don't poison the cache on transient dependency/filesystem issues.
modelCatalogPromise = null;