Skip to main content
Glama
logger.ts894 B
import winston from 'winston'; /** * Create a logger instance with formatted output */ export const logger = winston.createLogger({ level: process.env.LOG_LEVEL || 'info', format: winston.format.combine( winston.format.timestamp(), winston.format.errors({ stack: true }), winston.format.colorize(), winston.format.printf(({ timestamp, level, message, ...rest }) => { const restString = Object.keys(rest).length ? ` ${JSON.stringify(rest, null, 2)}` : ''; return `${timestamp} [${level}]: ${message}${restString}`; }) ), transports: [ new winston.transports.Console({ stderrLevels: ['error'], }), ], }); /** * Create a child logger with a specific context * * @param context - Context for the logger * @returns Child logger instance */ export function createContextLogger(context: string) { return logger.child({ context }); }

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/metcalfc/atrax'

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