Skip to main content
Glama

MCP Server Chart

Official
logger.ts1.39 kB
/** * Unified logger for consistent logging across the application */ const prefix = "[MCP-Server-Chart]"; /** * Indicates if the logger is in stdio mode. * When true, logs are directed to stderr for info, warn, and success messages, using console.error. * When false, logs are directed to stdout. */ let IS_STDIO = true; function setIsStdio(isStdio: boolean): void { IS_STDIO = isStdio; } function getPrefix(): string { const timestamp = new Date().toISOString(); return `${prefix} ${timestamp}`; } /** * Log info message */ function info(message: string, ...args: unknown[]): void { const fn = IS_STDIO ? console.error : console.log; fn(`${getPrefix()} ℹ️ ${message}`, ...args); } /** * Log warning message */ function warn(message: string, ...args: unknown[]): void { const fn = IS_STDIO ? console.warn : console.log; fn(`${getPrefix()} ⚠️ ${message}`, ...args); } /** * Log error message */ function error(message: string, error?: unknown): void { console.error(`${getPrefix()} ❌ ${message}`, error || ""); } /** * Log success message */ function success(message: string, ...args: unknown[]): void { const fn = IS_STDIO ? console.error : console.log; fn(`${getPrefix()} ✅ ${message}`, ...args); } /** * Logger object for backward compatibility */ export const logger = { info, warn, error, success, setIsStdio, };

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/antvis/mcp-server-chart'

If you have feedback or need assistance with the MCP directory API, please join our Discord server