()
| 193 | */ |
| 194 | function 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; |
no test coverage detected