Skip to main content
Glama
log-capture.ts846 B
export class LogCapture { private originalLog = console.log private originalError = console.error private logs: string[] = [] private errors: string[] = [] start(): void { console.log = (...args: any[]) => { try { this.logs.push(args.map(String).join(' ')) } catch {} this.originalLog.apply(console, args as any) } console.error = (...args: any[]) => { try { this.errors.push(args.map(String).join(' ')) } catch {} this.originalError.apply(console, args as any) } } stop(): void { console.log = this.originalLog console.error = this.originalError } find(substr: string): boolean { return this.logs.concat(this.errors).some((l) => l.includes(substr)) } dump(): { logs: string[]; errors: string[] } { return { logs: [...this.logs], errors: [...this.errors] } } }

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/Jakedismo/master-mcp-server'

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