Skip to main content
Glama

OpenAI SDK Knowledge MCP Server

by seratch
logger.ts1.13 kB
export type LogLevel = "debug" | "info" | "warn" | "error"; export class Logger { private static logLevel: LogLevel = "info"; static setLogLevel(level: LogLevel) { this.logLevel = level; } static getLogLevel(): LogLevel { return this.logLevel; } private static shouldLog(level: LogLevel): boolean { const levels: LogLevel[] = ["debug", "info", "warn", "error"]; const currentIndex = levels.indexOf(this.logLevel); const messageIndex = levels.indexOf(level); return messageIndex >= currentIndex; } static lazyDebug(message: () => string) { if (this.shouldLog("debug")) { console.log(`🔍 DEBUG: ${message()}`); } } static info(message: string, ...args: any[]) { if (this.shouldLog("info")) { console.log(`ℹ️ INFO: ${message}`, ...args); } } static warn(message: string, ...args: any[]) { if (this.shouldLog("warn")) { console.warn(`⚠️ WARN: ${message}`, ...args); } } static error(message: string, ...args: any[]) { if (this.shouldLog("error")) { console.error(`❌ ERROR: ${message}`, ...args); } } }

Latest Blog Posts

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/seratch/openai-sdk-knowledge-org'

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