fix: reuse shared ansi stripper

This commit is contained in:
Peter Steinberger
2026-01-17 18:18:14 +00:00
parent 3df2dc0b15
commit 408f4f2dac
2 changed files with 2 additions and 4 deletions

View File

@@ -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.

View File

@@ -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.