UNPKG

@ace-sdk/cli

Version:

ACE CLI - Command-line tool for intelligent pattern learning and playbook management

97 lines 2.7 kB
/** * CLI Logger - Unified Logging Layer for ACE CLI * * Implements ILogger from @ace-sdk/core with CLI-specific features: * - Respect for --json, --quiet, --verbose flags * - Proper stderr/stdout separation * - Spinner management for long-running operations * - Colored output via chalk * * @package @ace-sdk/cli */ import { Ora } from 'ora'; import type { ILogger } from '@ace-sdk/core'; export interface CliLoggerOptions { json: boolean; verbose: boolean; quiet: boolean; trace?: boolean; } /** * CLI Logger implementing ILogger interface * * Provides logging with CLI-specific enhancements like spinners * and colored output while being compatible with @ace-sdk/core */ export declare class CliLogger implements ILogger { private options; private activeSpinner; constructor(options: CliLoggerOptions); /** * Debug message (only shown with --verbose, to stderr) */ debug(message: string, data?: unknown): void; /** * Informational message (to stderr in non-JSON mode) */ info(message: string, data?: unknown): void; /** * Success message (to stderr in non-JSON mode) */ success(message: string, data?: unknown): void; /** * Warning message (to stderr) */ warn(message: string, data?: unknown): void; /** * Error message (to stderr) */ error(message: string, error?: Error | string): void; /** * Trace message (only shown with --trace, to stderr) */ trace(message: string, data?: unknown): void; /** * Check if we're in JSON mode */ isJson(): boolean; /** * Check if we're in quiet mode */ isQuiet(): boolean; /** * Check if we're in verbose mode */ isVerbose(): boolean; /** * Check if we're in trace mode */ isTrace(): boolean; /** * Create a spinner for long-running operations * Returns null if in JSON or quiet mode */ spinner(message: string): Ora | null; /** * Stop active spinner */ stopSpinner(): void; /** * Output data to stdout (for command results) * This is the ONLY method that writes to stdout */ output(data: unknown): void; /** * Direct stderr write (for diagnostics that should always appear) */ stderr(message: string): void; } export declare let globalOptions: CliLoggerOptions; export declare let logger: CliLogger; /** * Initialize global logger with options * Called from CLI entry point after parsing arguments */ export declare function initializeLogger(options: CliLoggerOptions): CliLogger; export { CliLogger as Logger }; //# sourceMappingURL=logger.d.ts.map