UNPKG

sfcc-dev-mcp

Version:

MCP server for Salesforce B2C Commerce Cloud development assistance including logs, debugging, and development tools

94 lines 3.43 kB
/** * Logger class for standardized logging across the SFCC MCP application. * Provides consistent logging with timestamps and log levels. * Always logs to files for consistent debugging and to avoid interfering with stdio. */ export declare class Logger { private context; private enableTimestamp; private debugEnabled; private logDir; /** * Create a new Logger instance * @param context The context/component name for this logger * @param enableTimestamp Whether to include timestamps in log messages (default: true) * @param debugEnabled Whether to enable debug logging (default: false) * @param customLogDir Custom log directory for testing purposes */ constructor(context?: string, enableTimestamp?: boolean, debugEnabled?: boolean, customLogDir?: string); /** * Format a log message with optional timestamp and context * @param message The message to format * @returns Formatted message string */ private formatMessage; /** * Write log message to appropriate log file */ private writeLog; /** * Log an informational message * @param message The message to log * @param args Optional arguments to include */ log(message: string, ...args: any[]): void; /** * Log an informational message (alias for log) * @param message The message to log * @param args Optional arguments to include */ info(message: string, ...args: any[]): void; /** * Log a warning message * @param message The warning message to log * @param args Optional arguments to include */ warn(message: string, ...args: any[]): void; /** * Log an error message * @param message The error message to log * @param args Optional arguments to include */ error(message: string, ...args: any[]): void; /** * Log a debug message (only if debug is enabled) * @param message The debug message to log * @param args Optional arguments to include */ debug(message: string, ...args: any[]): void; /** * Log method entry with parameters * @param methodName The name of the method being entered * @param params Optional parameters being passed to the method */ methodEntry(methodName: string, params?: any): void; /** * Log method exit with optional result * @param methodName The name of the method being exited * @param result Optional result being returned from the method */ methodExit(methodName: string, result?: any): void; /** * Log performance timing information * @param operation The operation being timed * @param startTime The start time (from performance.now() or Date.now()) */ timing(operation: string, startTime: number): void; /** * Create a child logger with a new context but inheriting other settings * @param subContext The sub-context to append to the current context * @returns A new Logger instance with the combined context */ createChildLogger(subContext: string): Logger; /** * Enable or disable debug logging * @param enabled Whether debug logging should be enabled */ setDebugEnabled(enabled: boolean): void; /** * Get the current log directory */ getLogDirectory(): string; } export declare const logger: Logger; //# sourceMappingURL=logger.d.ts.map