UNPKG

scai

Version:

> **A local-first AI CLI for understanding, querying, and iterating on large codebases.** > **100% local • No token costs • No cloud • No prompt injection • Private by design**

18 lines (17 loc) 640 B
import { LOG_PATH } from "../constants.js"; import fs from 'fs'; export const DEBUG = false; export const SUMMARY_LENGTH = 120; export function log(...args) { const timestamp = new Date().toISOString(); const message = args.map(arg => typeof arg === 'string' ? arg : JSON.stringify(arg, null, 2)).join(' '); const isBackground = process.env.BACKGROUND_MODE === 'true'; if (isBackground) { // If running in background, log to a file fs.appendFileSync(LOG_PATH, `[${timestamp}] ${message}\n`); } else { // Otherwise, log to the console console.log(`[${timestamp}] ${message}`); } }