git-aiflow
Version:
🚀 An AI-powered workflow automation tool for effortless Git-based development, combining smart GitLab/GitHub merge & pull request creation with Conan package management.
133 lines • 3.51 kB
TypeScript
import winston from 'winston';
/**
* Log levels
*/
export declare enum LogLevel {
ERROR = "error",
WARN = "warn",
INFO = "info",
HTTP = "http",
VERBOSE = "verbose",
DEBUG = "debug",
SILLY = "silly"
}
/**
* Logger configuration
*/
interface LoggerConfig {
level: LogLevel;
consoleLevel: LogLevel;
maxSize: string;
maxFiles: number;
logDir: string;
enableConsole: boolean;
/** Buffer size for file writes (bytes) */
bufferSize: number;
/** Auto-flush interval (milliseconds) */
flushInterval: number;
/** Enable lazy file creation */
lazy: boolean;
/** High water mark for streams */
highWaterMark: number;
}
/**
* Logger class with convenient methods
*/
export declare class Logger {
private static instance;
static shutdownLogger: (() => Promise<void>) | null;
private winston;
private isShuttingDown;
private constructor();
/**
* Get singleton instance
*/
static getInstance(config?: Partial<LoggerConfig>): Logger;
/**
* Create logger for specific context (deprecated, use getInstance instead)
*/
static create(_context: string, config?: Partial<LoggerConfig>): Logger;
/**
* Configure global logger settings
*/
static configure(config: Partial<LoggerConfig>): void;
/**
* Reset singleton instance (useful for testing)
*/
static reset(): void;
/**
* Check if singleton instance exists
*/
static hasInstance(): boolean;
/**
* Clear caller cache (useful for testing or memory management)
*/
static clearCache(): void;
/**
* Get cache size (for debugging)
*/
static getCacheSize(): number;
private formatMessage;
error(message: string, error?: Error | any): void;
warn(message: string, meta?: any): void;
info(message: string, meta?: any): void;
http(message: string, meta?: any): void;
verbose(message: string, meta?: any): void;
debug(message: string, meta?: any): void;
silly(message: string, meta?: any): void;
/**
* Log shell command execution
*/
shell(command: string, result?: string, error?: Error): void;
/**
* Log HTTP request/response
*/
httpRequest(method: string, url: string, status?: number, duration?: number): void;
/**
* Log service operations
*/
service(operation: string, service: string, meta?: any): void;
/**
* Get underlying Winston instance
*/
getWinston(): winston.Logger;
/**
* Force flush all file transports
*/
flush(): void;
/**
* Get current buffer stats (if available)
*/
getBufferStats(): {
transportType: string;
buffered?: number;
highWaterMark?: number;
}[];
}
/**
* Default logger instance (singleton)
*/
export declare const logger: Logger;
/**
* Mark logger as shutting down (prevent new logs)
*/
export declare function markLoggerShuttingDown(): void;
/**
* Gracefully shutdown logger (close file streams)
*/
export declare function shutdownLogger(): Promise<void>;
/**
* Configure global logging
*/
export declare function configureLogging(config: Partial<LoggerConfig>): void;
/**
* Get the global logs directory path
*/
export declare function getLogsDir(): string;
/**
* Test function to verify stack trace parsing
* This can be removed in production
*/
export declare function testLoggerContext(): void;
export {};
//# sourceMappingURL=logger.d.ts.map