mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-15 23:00:46 +00:00
24 lines
627 B
TypeScript
24 lines
627 B
TypeScript
import { normalizeLowercaseStringOrEmpty } from "./string-utils.js";
|
|
|
|
const debugEmbeddings = isTruthyEnvValue(process.env.OPENCLAW_DEBUG_MEMORY_EMBEDDINGS);
|
|
|
|
export function debugEmbeddingsLog(message: string, meta?: Record<string, unknown>): void {
|
|
if (!debugEmbeddings) {
|
|
return;
|
|
}
|
|
const suffix = meta ? ` ${JSON.stringify(meta)}` : "";
|
|
process.stderr.write(`${message}${suffix}\n`);
|
|
}
|
|
|
|
function isTruthyEnvValue(value?: string): boolean {
|
|
switch (normalizeLowercaseStringOrEmpty(value)) {
|
|
case "1":
|
|
case "on":
|
|
case "true":
|
|
case "yes":
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|