MCPcopy
hub / github.com/darkreader/darkreader / sendLog

Function sendLog

src/background/utils/sendLog.ts:18–29  ·  view source on GitHub ↗
(level: 'info' | 'warn' | 'assert', ...args: any[])

Source from the content-addressed store, hash-verified

16}
17
18export function sendLog(level: 'info' | 'warn' | 'assert', ...args: any[]): void {
19 if (!__DEBUG__ || !__LOG__) {
20 return;
21 }
22 const message = JSON.stringify({level, log: args});
23 if (socket && socket.readyState === socket.OPEN) {
24 socket.send(message);
25 } else {
26 createSocket();
27 messageQueue.push(message);
28 }
29}

Callers 5

index.tsFile · 0.90
logInfoFunction · 0.90
logWarnFunction · 0.90
logInfoCollapsedFunction · 0.90
logAssertFunction · 0.90

Calls 1

createSocketFunction · 0.85

Tested by

no test coverage detected