UNPKG

docxmcp

Version:

A Model Context Protocol (MCP) server for processing .docx files into markdown with image extraction

37 lines (30 loc) 817 B
// Logging utility that respects log level environment variable const LOG_LEVELS = { debug: 0, info: 1, warn: 2, error: 3 }; const currentLogLevel = LOG_LEVELS[process.env.DOCXMCP_LOG_LEVEL || 'info']; export const log = { debug: (...args) => { if (currentLogLevel <= LOG_LEVELS.debug) { console.error('[DEBUG]', ...args); } }, info: (...args) => { if (currentLogLevel <= LOG_LEVELS.info) { console.error('[INFO]', ...args); } }, warn: (...args) => { if (currentLogLevel <= LOG_LEVELS.warn) { console.error('[WARN]', ...args); } }, error: (...args) => { if (currentLogLevel <= LOG_LEVELS.error) { console.error('[ERROR]', ...args); } } };