MCPcopy
hub / github.com/darkreader/darkreader / sendLogToBG

Function sendLogToBG

src/inject/utils/log.ts:9–14  ·  view source on GitHub ↗
(level: 'info' | 'warn' | 'assert', ...args: any[])

Source from the content-addressed store, hash-verified

7declare const __LOG__: 'info' | 'warn';
8
9function sendLogToBG(level: 'info' | 'warn' | 'assert', ...args: any[]) {
10 if (__WATCH__ && __LOG__ && (__LOG__ === 'info' || level === 'warn')) {
11 // No need to generate contextId since we do not expect a response
12 chrome.runtime.sendMessage<DebugMessageCStoBG>({type: DebugMessageTypeCStoBG.LOG, data: {level, log: args}});
13 }
14}
15
16export function logInfo(...args: any[]): void {
17 if (__DEBUG__) {

Callers 3

logInfoFunction · 0.85
logWarnFunction · 0.85
logAssertFunction · 0.85

Calls 1

sendMessageMethod · 0.80

Tested by

no test coverage detected