/** * Centralized pino logger factory for CLEO. * * Singleton pattern. Uses pino-roll for automatic file rotation and retention. * Custom formatters for uppercase level labels and ISO timestamps. * Context via child loggers (getLogger('subsystem')). * * All diagnostic logging goes to files — stdout is reserved for structured * CLI output. Fallback stderr logger if not yet initialized. */ import type { LoggerConfig } from '@cleocode/contracts'; import pino from 'pino'; export type { LoggerConfig }; /** * Enable or disable quiet mode for the logger subsystem. * * When quiet=true: * - The stderr fallback `getLogger()` returns silent-level loggers. * - If the root logger is initialized, its level is set to 'silent'. * * Critical CLI errors that route through `cliError()` and `process.exit()` * are emitted via direct stderr writes outside this subsystem and are NOT * affected by quiet mode — see T9933 spec. * * @task T9933 */ export declare function setLoggerQuiet(quiet: boolean): void; /** * Inspect the current quiet-mode flag. Exposed for tests + diagnostics. * * @task T9933 */ export declare function isLoggerQuiet(): boolean; /** * Initialize the root logger. Call once at startup. * * Uses pino-roll for automatic size+daily rotation with built-in retention. * No custom rotation code needed. * * @param cleoDir - Absolute path to .cleo directory * @param config - Logging configuration from CleoConfig.logging * @param projectHash - Stable project identity token bound to every log entry. * Optional for backward compatibility; warns if absent. * @returns The root pino logger instance */ export declare function initLogger(cleoDir: string, config: LoggerConfig, projectHash?: string): pino.Logger; /** * Get a child logger bound to a subsystem name. * * Safe to call before initLogger — returns a stderr fallback logger * so early startup code and tests never crash. * * @param subsystem - Logical subsystem name (e.g. 'audit', 'dispatch', 'migration') */ export declare function getLogger(subsystem: string): pino.Logger; /** * Get the current log directory path. * Useful for read APIs that need to scan log files. */ export declare function getLogDir(): string | null; /** * Flush and close the logger. Call during graceful shutdown. * * Returns a Promise that resolves once the pino transport worker thread * has processed all pending writes. Callers that cannot await (e.g. sync * shutdown handlers) may fire-and-forget safely — the underlying flush * will still occur before the process exits. */ export declare function closeLogger(): Promise; //# sourceMappingURL=logger.d.ts.map