UNPKG

@gluneau/hive-mcp-server

Version:

An MCP server that enables AI assistants to interact with the Hive blockchain

54 lines 1.3 kB
"use strict"; // Logging utility for consistent logging // Avoids using console.log/console.error as per requirements Object.defineProperty(exports, "__esModule", { value: true }); exports.setLogLevel = setLogLevel; exports.debug = debug; exports.info = info; exports.warn = warn; exports.error = error; const levels = { debug: 0, info: 1, warn: 2, error: 3, }; let currentLevel = 'info'; function setLogLevel(level) { currentLevel = level; } function shouldLog(level) { return levels[level] >= levels[currentLevel]; } function formatLog(level, message) { const timestamp = new Date().toISOString(); return `[${timestamp}] [${level.toUpperCase()}] ${message}\n`; } function debug(message) { if (shouldLog('debug')) { process.stderr.write(formatLog('debug', message)); } } function info(message) { if (shouldLog('info')) { process.stderr.write(formatLog('info', message)); } } function warn(message) { if (shouldLog('warn')) { process.stderr.write(formatLog('warn', message)); } } function error(message) { if (shouldLog('error')) { process.stderr.write(formatLog('error', message)); } } exports.default = { debug, info, warn, error, setLogLevel, }; //# sourceMappingURL=logger.js.map