/** * Structured logging for vibe-validate * * Logs are only output when VV_DEBUG=1 environment variable is set. * This provides visibility into silent failures without cluttering production output. */ export type LogCategory = 'cache' | 'validation' | 'git' | 'config' | 'extraction' | 'perf'; export interface LogContext { category: LogCategory; message: string; error?: Error; metadata?: Record; } /** * Log a debug message * Only outputs when VV_DEBUG=1 * * @example * ```typescript * logDebug('cache', 'Cache lookup', { treeHash, cacheKey }); * ``` */ export declare function logDebug(category: LogCategory, message: string, metadata?: Record): void; /** * Log a warning (non-critical error) * Only outputs when VV_DEBUG=1 * * @example * ```typescript * logWarning('cache', 'Cache lookup failed - proceeding with execution', error); * ``` */ export declare function logWarning(category: LogCategory, message: string, error?: Error): void; /** * Log an error (critical failure) * Always outputs, even without VV_DEBUG * * @example * ```typescript * logError('validation', 'Failed to load config', error); * ``` */ export declare function logError(category: LogCategory, message: string, error?: Error): void; /** * Performance timing helper for VV_DEBUG instrumentation * * Creates a timer that logs elapsed time for operations. * Zero overhead when VV_DEBUG is not set (returns no-op functions). * * If an operation exceeds its threshold, logs a LOUD warning to stderr * regardless of VV_DEBUG setting — these indicate performance regressions. * * @example * ```typescript * const timer = createPerfTimer('validate'); * // ... do work ... * timer.mark('config loaded'); * // ... do more work ... * timer.mark('tree hash computed'); * timer.done(); // logs full breakdown * ``` */ export interface PerfTimer { /** Record a timing mark with label */ mark(label: string): void; /** Record a timing mark and warn if elapsed since last mark exceeds threshold (ms) */ markWithThreshold(label: string, thresholdMs: number): void; /** Log the full timing breakdown (VV_DEBUG only) */ done(): void; } export declare function createPerfTimer(context: string): PerfTimer; //# sourceMappingURL=logger.d.ts.map