MCPcopy Create free account
hub / github.com/Noumena-Network/code / log

Function log

src/utils/claudeInChrome/chromeNativeHost.ts:39–51  ·  view source on GitHub ↗
(message: string, ...args: unknown[])

Source from the content-addressed store, hash-verified

37const LOG_FILE = getChromeNativeHostLogFilePath()
38
39function log(message: string, ...args: unknown[]): void {
40 if (LOG_FILE) {
41 const timestamp = new Date().toISOString()
42 const formattedArgs = args.length > 0 ? ' ' + jsonStringify(args) : ''
43 const logLine = `[${timestamp}] [Claude Chrome Native Host] ${message}${formattedArgs}\n`
44 // Fire-and-forget: logging is best-effort and callers (including event
45 // handlers) don't await
46 void appendFile(LOG_FILE, logLine).catch(() => {
47 // Ignore file write errors
48 })
49 }
50 console.error(`[Claude Chrome Native Host] ${message}`, ...args)
51}
52/**
53 * Send a message to stdout (Chrome native messaging protocol)
54 */

Callers 9

runChromeNativeHostFunction · 0.85
startMethod · 0.85
stopMethod · 0.85
handleMessageMethod · 0.85
handleMcpClientMethod · 0.85
tryProcessMessageMethod · 0.85
runBridgeHeadlessFunction · 0.85

Calls 2

jsonStringifyFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected