MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / getLogPrefix

Function getLogPrefix

src/runtime_debug.js:195–214  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

193 */
194function initWorkerLogging() {
195 function getLogPrefix() {
196#if WASM_WORKERS
197 if (wwParams?.wwID) {
198 return `ww:${wwParams?.wwID}:`
199 }
200#endif
201#if PTHREADS
202 var t = 0;
203 if (runtimeInitialized && typeof _pthread_self != 'undefined'
204#if EXIT_RUNTIME
205 && !runtimeExited
206#endif
207 ) {
208 t = _pthread_self();
209 }
210 return `w:${workerID},t:${ptrToString(t)}:`;
211#else
212 return `ww:0:`;
213#endif
214 }
215
216 // Prefix all dbg() messages with the calling thread info.
217 var origDbg = dbg;

Callers 1

initWorkerLoggingFunction · 0.85

Calls 1

ptrToStringFunction · 0.85

Tested by

no test coverage detected