MCPcopy Create free account
hub / github.com/tiann/hapi / sendToRemoteServer

Method sendToRemoteServer

cli/src/ui/logger.ts:180–200  ·  view source on GitHub ↗
(level: string, message: string, ...args: unknown[])

Source from the content-addressed store, hash-verified

178 }
179
180 private async sendToRemoteServer(level: string, message: string, ...args: unknown[]): Promise<void> {
181 if (!this.dangerouslyUnencryptedServerLoggingUrl) return
182
183 try {
184 await fetch(this.dangerouslyUnencryptedServerLoggingUrl + '/logs-combined-from-cli-and-mobile-for-simple-ai-debugging', {
185 method: 'POST',
186 headers: { 'Content-Type': 'application/json' },
187 body: JSON.stringify({
188 timestamp: new Date().toISOString(),
189 level,
190 message: `${message} ${args.map(a =>
191 typeof a === 'object' ? JSON.stringify(a, null, 2) : String(a)
192 ).join(' ')}`,
193 source: 'cli',
194 platform: process.platform
195 })
196 })
197 } catch (error) {
198 // Silently fail to avoid disrupting the session
199 }
200 }
201
202 private logToFile(prefix: string, message: string, ...args: unknown[]): void {
203 const logLine = `${prefix} ${message} ${args.map(arg =>

Callers 1

logToFileMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected