From 5d001cb9531cc0031b9d548e9c70eb4df599e578 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 23 Jan 2026 04:16:32 +0000 Subject: [PATCH] refactor: add config logging helpers --- src/config/logging.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/config/logging.ts diff --git a/src/config/logging.ts b/src/config/logging.ts new file mode 100644 index 000000000..72c097d7a --- /dev/null +++ b/src/config/logging.ts @@ -0,0 +1,18 @@ +import type { RuntimeEnv } from "../runtime.js"; +import { displayPath } from "../utils.js"; +import { CONFIG_PATH_CLAWDBOT } from "./paths.js"; + +type LogConfigUpdatedOptions = { + path?: string; + suffix?: string; +}; + +export function formatConfigPath(path: string = CONFIG_PATH_CLAWDBOT): string { + return displayPath(path); +} + +export function logConfigUpdated(runtime: RuntimeEnv, opts: LogConfigUpdatedOptions = {}): void { + const path = formatConfigPath(opts.path ?? CONFIG_PATH_CLAWDBOT); + const suffix = opts.suffix ? ` ${opts.suffix}` : ""; + runtime.log(`Updated ${path}${suffix}`); +}