emscripten-core / emscripten-core/emscripten

Add a custom logging facility along with console.error in threadPrintErr function.

Open
#12,811 1 comment 0 reactions 0 assignees View on GitHub
wontfix
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Hi Team,

It will be great to add a custom logging facility along with 'console.error' in threads print error in a worker, which queues the messages to the main thread to print error.
https://github.com/emscripten-core/emscripten/blob/5568b81f8e1d0be1a2ae2469b457a9f60df08658/src/worker.js#L29
Like the following coding
```
function threadPrintErr() {
var text = Array.prototype.slice.call(arguments).join(' ');
postMessage({cmd: 'printErr', text: text, threadId: selfThreadId});
console.error(text);
}
```
This will provide more control on how to show the error message in the real-world application. Just showing an error message on the dev tool is not sufficient for real-world applications.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.