UNPKG

@typecad/kicad-symbols

Version:

Intelligent fuzzy search for KiCad symbols with CLI interface

104 lines 2.6 kB
/** * Log levels for the Logger */ export declare enum LogLevel { DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3, NONE = 4 } /** * Configuration options for the Logger */ export interface LoggerOptions { /** * Minimum log level to display in the console */ consoleLevel: LogLevel; /** * Minimum log level to write to the log file */ fileLevel: LogLevel; /** * Whether to include timestamps in log messages */ includeTimestamps: boolean; /** * Directory to store log files */ logDir: string; /** * Maximum size of log files in bytes before rotation */ maxLogSize: number; /** * Maximum number of log files to keep */ maxLogFiles: number; } /** * Logger class for debugging and monitoring */ export declare class Logger { private static instance; private readonly options; private logFilePath; private logFileSize; /** * Creates a new Logger instance * @param options - Configuration options for the Logger */ private constructor(); /** * Gets the Logger instance (singleton) * @param options - Configuration options for the Logger * @returns The Logger instance */ static getInstance(options?: Partial<LoggerOptions>): Logger; /** * Ensures the log directory exists */ private ensureLogDir; /** * Logs a debug message * @param message - Message to log * @param data - Additional data to log */ debug(message: string, data?: any): Promise<void>; /** * Logs an info message * @param message - Message to log * @param data - Additional data to log */ info(message: string, data?: any): Promise<void>; /** * Logs a warning message * @param message - Message to log * @param data - Additional data to log */ warn(message: string, data?: any): Promise<void>; /** * Logs an error message * @param message - Message to log * @param error - Error to log */ error(message: string, error?: unknown): Promise<void>; /** * Logs a message with the specified level * @param level - Log level * @param message - Message to log * @param data - Additional data to log */ private log; /** * Writes a message to the log file * @param message - Message to write */ private writeToLogFile; /** * Rotates log files when the current log file gets too large */ private rotateLogFiles; } //# sourceMappingURL=Logger.d.ts.map