Open OoDeLally opened 1 year ago
You can replace console.log
in the worker itself. There is no built in feature that enables you to do this? What is your usecase?
The worker code is a third-party source code, and it is run with all permissions turned off. The goal is to prevent the worker to access the raw console, and instead wrap it into a custom logger.
I need the parent thread to transform whatever the worker logs on the console, e.g.
I got it working with pipes for child processes. However I cannot see any method to do that with workers. I've also tried to temporarily override
console.log
into a wrapper in the parent before creating the worker, in vain. Is there a theoretical reason I could not do that, or is it merely a missing feature? Thanks