/** * Minimal leveled logger that writes to **stderr only**. * * On the stdio transport, stdout is reserved for the MCP JSON-RPC stream — * anything written there corrupts the protocol. Every diagnostic in this * server therefore goes through here, which is hard-wired to stderr. * * The sink is injectable so the bootstrap and tests can capture output without * touching the real `process.stderr`. */ import { LOG_LEVELS, type TwinklyMcpConfig } from './config.js'; export type LogLevel = (typeof LOG_LEVELS)[number]; /** Where a logger writes a finished line. Defaults to `process.stderr`. */ export type LogSink = (line: string) => void; export interface Logger { error(message: string, ...rest: unknown[]): void; warn(message: string, ...rest: unknown[]): void; info(message: string, ...rest: unknown[]): void; debug(message: string, ...rest: unknown[]): void; } /** * Create a logger that emits at or below `level`. `sink` is injectable for * tests; production passes the default stderr sink. */ export declare function createLogger(level: TwinklyMcpConfig['logLevel'], sink?: LogSink): Logger;