diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e5699818..1c268b6b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -74,6 +74,7 @@ Docs: https://docs.clawd.bot - Verbose: wrap tool summaries/output in markdown only for markdown-capable channels. - Tools: include provider/session context in elevated exec denial errors. - Tools: normalize exec tool alias naming in tool error logs. +- Logging: reuse shared ANSI stripping to keep console capture lint-clean. - Telegram: accept tg/group/telegram prefixes + topic targets for inline button validation. (#1072) — thanks @danielz1z. - Telegram: split long captions into follow-up messages. - Config: block startup on invalid config, preserve best-effort doctor config, and keep rolling config backups. (#1083) — thanks @mukhtharcm. diff --git a/src/logging/console.ts b/src/logging/console.ts index 013ec4bfb..4e1346242 100644 --- a/src/logging/console.ts +++ b/src/logging/console.ts @@ -2,6 +2,7 @@ import util from "node:util"; import { type ClawdbotConfig, loadConfig } from "../config/config.js"; import { isVerbose } from "../globals.js"; +import { stripAnsi } from "../terminal/ansi.js"; import { type LogLevel, normalizeLogLevel } from "./levels.js"; import { getLogger, type LoggerSettings } from "./logger.js"; import { loggingState } from "./state.js"; @@ -120,10 +121,6 @@ function isJsonPayload(value: string): boolean { } } -function stripAnsi(value: string): string { - return value.replace(/\u001b\[[0-9;]*m/g, ""); -} - /** * Route console.* calls through file logging while still emitting to stdout/stderr. * This keeps user-facing output unchanged but guarantees every console call is captured in log files.