Skip to main content
Glama

MCP Manual Generator

by haixyeh
logger.js1.64 kB
const winston = require('winston'); const path = require('path'); const logLevels = { error: 0, warn: 1, info: 2, debug: 3 }; const logColors = { error: 'red', warn: 'yellow', info: 'green', debug: 'blue' }; winston.addColors(logColors); const logger = winston.createLogger({ levels: logLevels, level: process.env.LOG_LEVEL || 'info', format: winston.format.combine( winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }), winston.format.errors({ stack: true }), winston.format.splat(), winston.format.json() ), defaultMeta: { service: 'mcp-manual-generator' }, transports: [] }); // Console transport for development if (process.env.NODE_ENV !== 'production') { logger.add(new winston.transports.Console({ format: winston.format.combine( winston.format.colorize(), winston.format.simple(), winston.format.printf(({ level, message, timestamp, ...metadata }) => { let msg = `${timestamp} [${level}]: ${message}`; if (Object.keys(metadata).length > 0) { msg += ` ${JSON.stringify(metadata)}`; } return msg; }) ) })); } // File transport for production if (process.env.NODE_ENV === 'production') { logger.add(new winston.transports.File({ filename: path.join('logs', 'error.log'), level: 'error' })); logger.add(new winston.transports.File({ filename: path.join('logs', 'combined.log') })); } module.exports = logger;

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/haixyeh/mcp-manual-generator'

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