Skip to main content
Glama

PostgreSQL MCP Server

by sreedhag
logger.ts946 B
// logger.ts const verbose = process.argv.includes("--verbose") || process.env.VERBOSE === "true"; type LogLevel = "info" | "warn" | "error"; const COLORS = { info: "\x1b[34m", // Blue warn: "\x1b[33m", // Yellow error: "\x1b[31m", // Red reset: "\x1b[0m", }; function getTimestamp(): string { const now = new Date(); return now.toISOString(); // ISO format: "2025-04-05T10:00:00Z" } const logger = { info(...args: any[]) { if (verbose) { console.log( `${COLORS.info}[${getTimestamp()}] INFO:${COLORS.reset}`, ...args, ); } }, warn(...args: any[]) { if (verbose) { console.log( `${COLORS.warn}[${getTimestamp()}] WARN:${COLORS.reset}`, ...args, ); } }, error(...args: any[]) { if (verbose) { console.error( `${COLORS.error}[${getTimestamp()}] ERROR:${COLORS.reset}`, ...args, ); } }, }; export { 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/sreedhag/postgres-mcp-server'

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