MCPcopy
hub / github.com/browserless/browserless / emit

Method emit

src/logger.ts:109–119  ·  view source on GitHub ↗
(fn: (...args: unknown[]) => void, messages: unknown[])

Source from the content-addressed store, hash-verified

107 // is disabled (the common case for trace/debug in production). Falls
108 // through when `enabled` is absent, e.g. SDK overrides with plain fns.
109 protected emit(fn: (...args: unknown[]) => void, messages: unknown[]) {
110 if ((fn as { enabled?: boolean }).enabled === false) {
111 return;
112 }
113 const prefix = this.contextPrefix;
114 if (prefix) {
115 fn(prefix, ...messages);
116 } else {
117 fn(...messages);
118 }
119 }
120
121 public trace(...messages: unknown[]) {
122 this.emit(this._trace, messages);

Callers 15

traceMethod · 0.95
debugMethod · 0.95
infoMethod · 0.95
warnMethod · 0.95
errorMethod · 0.95
fatalMethod · 0.95
oeFunction · 0.80
aeFunction · 0.80
eFunction · 0.80
docs.jsFile · 0.80
setDataDirMethod · 0.80
setRoutesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected