fix: reuse shared ansi stripper
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user