UNPKG

@uplinq/mcp-vitest

Version:

MCP server for Vitest with watch-mode support for fast test feedback

31 lines 835 B
/** * Transport-aware logger that ensures stdio transport compatibility * When using stdio transport, logs go to stderr to avoid interfering with JSON-RPC on stdout */ let isStdioTransport = false; /** * Set whether we're using stdio transport */ export function setStdioTransport(enabled) { isStdioTransport = enabled; } /** * Log a message, directing to stderr if using stdio transport */ export function log(...args) { if (isStdioTransport) { // Use stderr for stdio transport to avoid interfering with JSON-RPC on stdout console.error(...args); } else { // Use stdout for other transports (SSE, HTTP) console.log(...args); } } /** * Log an error (always goes to stderr) */ export function error(...args) { console.error(...args); } //# sourceMappingURL=logger.js.map