UNPKG

@digitalsamba/embedded-api-mcp-server

Version:

Digital Samba Embedded API MCP Server - Model Context Protocol server for Digital Samba's Embedded API

35 lines 1.01 kB
/** * Simple logger for Digital Samba MCP Server * Uses console methods that write to stderr to avoid interfering with stdio transport */ const LOG_LEVELS = { error: 0, warn: 1, info: 2, debug: 3, }; const currentLogLevel = LOG_LEVELS[process.env.DS_LOG_LEVEL] ?? LOG_LEVELS.warn; const logger = { error: (message, ...args) => { if (currentLogLevel >= LOG_LEVELS.error) { console.error(`[ERROR] ${message}`, ...args); } }, warn: (message, ...args) => { if (currentLogLevel >= LOG_LEVELS.warn) { console.error(`[WARN] ${message}`, ...args); } }, info: (message, ...args) => { if (currentLogLevel >= LOG_LEVELS.info) { console.error(`[INFO] ${message}`, ...args); } }, debug: (message, ...args) => { if (currentLogLevel >= LOG_LEVELS.debug) { console.error(`[DEBUG] ${message}`, ...args); } }, }; export default logger; //# sourceMappingURL=logger.js.map