MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / attachErrorLogSink

Function attachErrorLogSink

source code/utils/log.ts:111–136  ·  view source on GitHub ↗
(newSink: ErrorLogSink)

Source from the content-addressed store, hash-verified

109 * the default command) without coordination.
110 */
111export function attachErrorLogSink(newSink: ErrorLogSink): void {
112 if (errorLogSink !== null) {
113 return
114 }
115 errorLogSink = newSink
116
117 // Drain the queue immediately - errors should not be delayed
118 if (errorQueue.length > 0) {
119 const queuedEvents = [...errorQueue]
120 errorQueue.length = 0
121
122 for (const event of queuedEvents) {
123 switch (event.type) {
124 case 'error':
125 errorLogSink.logError(event.error)
126 break
127 case 'mcpError':
128 errorLogSink.logMCPError(event.serverName, event.error)
129 break
130 case 'mcpDebug':
131 errorLogSink.logMCPDebug(event.serverName, event.message)
132 break
133 }
134 }
135 }
136}
137
138/**
139 * Logs an error to multiple destinations for debugging and monitoring.

Callers 1

initializeErrorLogSinkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected