/** * Logger Implementation for MCP Server * * Provides a configurable logging system that writes to stderr * (to avoid polluting stdout which is used for MCP protocol messages). */ import type { LogLevel as MCPLogLevel, Logger as MCPLogger } from '../types'; /** * Log level enum for backward compatibility */ export declare enum LogLevel { DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3, SILENT = 4 } /** * Logger interface for backward compatibility */ export interface Logger { debug: (message: string, ...args: unknown[]) => void; info: (message: string, ...args: unknown[]) => void; warn: (message: string, ...args: unknown[]) => void; error: (message: string, ...args: unknown[]) => void; } /** * Create a logger instance with the specified log level */ export declare function createLogger(level?: LogLevel): Logger; /** * Console Logger Implementation for MCP Protocol * * Logs messages to stderr with timestamp and level formatting. * Respects the configured minimum log level. * Implements the MCPLogger interface for protocol compliance. */ export declare class ConsoleLogger implements MCPLogger { private readonly minLevel; private readonly minPriority; private readonly prefix; constructor(minLevel?: MCPLogLevel, prefix?: string); /** * Check if a log level should be output */ private shouldLog; /** * Format a log message */ private formatMessage; /** * Write a log message to stderr */ private writeLog; debug(message: string, data?: unknown): void; info(message: string, data?: unknown): void; notice(message: string, data?: unknown): void; warning(message: string, data?: unknown): void; error(message: string, data?: unknown): void; critical(message: string, data?: unknown): void; alert(message: string, data?: unknown): void; emergency(message: string, data?: unknown): void; } /** * JSON Logger Implementation * * Outputs structured JSON logs to stderr, suitable for log aggregation systems. */ export declare class JsonLogger implements MCPLogger { private readonly minLevel; private readonly minPriority; private readonly metadata; constructor(minLevel?: MCPLogLevel, metadata?: Record); private shouldLog; private writeLog; debug(message: string, data?: unknown): void; info(message: string, data?: unknown): void; notice(message: string, data?: unknown): void; warning(message: string, data?: unknown): void; error(message: string, data?: unknown): void; critical(message: string, data?: unknown): void; alert(message: string, data?: unknown): void; emergency(message: string, data?: unknown): void; } /** * Silent Logger Implementation * * No-op logger that discards all messages. Useful for testing. */ export declare class SilentLogger implements MCPLogger { debug(): void; info(): void; notice(): void; warning(): void; error(): void; critical(): void; alert(): void; emergency(): void; } /** * Create an MCP-compatible logger based on configuration */ export declare function createMCPLogger(level?: MCPLogLevel, format?: 'text' | 'json', metadata?: Record): MCPLogger; //# sourceMappingURL=logger.d.ts.map