/** * v0.8.3 §5.1 — logger extension. * * Adds three orthogonal capabilities while keeping every existing call * site (`logger.info / warn / error / success / dim`) byte-compatible: * * 1. Log levels via `SOLOSQUAD_LOG_LEVEL` (error / warn / info / debug) * 2. Optional JSON output via `SOLOSQUAD_LOG_FORMAT=json` * 3. Optional file mirror via `SOLOSQUAD_LOG_FILE=1` → * `/.solosquad/logs/solosquad-YYYY-MM-DD.log` with date * rolling. Retention (14d) is enforced by the daily log-rotate * cron; the logger itself only writes the current day. * * Env reads happen *per call* (not module load) so tests can flip env * vars between scenarios without re-importing. */ export type LogLevel = "error" | "warn" | "info" | "debug"; declare function activeLevel(): LogLevel; declare function activeFormat(): "text" | "json"; declare function fileOutputEnabled(): boolean; /** * Resolve the workspace root for log file writes. We avoid importing * `getWorkspaceRoot()` to keep this module free of cross-package * cycles (paths.ts → migrations/detect → util). Instead we accept an * env-override `SOLOSQUAD_LOG_DIR` for tests and otherwise walk up from * cwd looking for `.solosquad/`. */ declare function resolveLogDir(): string | null; export declare function currentLogFile(now?: Date): string | null; /** * v0.8.3 — file-only convenience for direct log writes (e.g. tests). * Skips console entirely. Honors level + format. */ export declare function logRaw(level: LogLevel, message: string, tag?: string): void; export declare const logger: { info(tag: string, message: string): void; success(message: string): void; warn(message: string): void; error(message: string): void; dim(message: string): void; debug(message: string, tag?: string): void; }; /** * v0.8.3 — Retention pass for the daily log-rotate cron. * Deletes solosquad-YYYY-MM-DD.log files older than `retentionDays`. * Returns the list of removed file paths. */ export declare function rotateLogs(opts?: { retentionDays?: number; logDir?: string; now?: Date; }): string[]; /** Test helper — exposes internal env reads so tests can verify dynamic behavior. */ export declare const _loggerInternals: { activeLevel: typeof activeLevel; activeFormat: typeof activeFormat; fileOutputEnabled: typeof fileOutputEnabled; resolveLogDir: typeof resolveLogDir; }; export {};