mateversum icon indicating copy to clipboard operation
mateversum copied to clipboard

Implement logging in main() from query param

Open ianklatzco opened this issue 3 years ago • 1 comments

https://github.com/expenses/mateversum/blob/master/src/lib.rs#L51

Problem: web worker main thread - different global object - not window.foo, but rather worker.foo

To solve: should just be as easy as passing the query param into console_log::init_with_level ?

From https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/location

console.log(location); inside a worker should return an object->href shaped like http://localhost:8000/worker.js, which might not contain the query params passed by the user.

ianklatzco avatar Jun 24 '22 20:06 ianklatzco

Could pass the query params from orig url when we start the workers. But might be easier to just postMessage the relevant data directly to the workers on worker init.

ianklatzco avatar Jun 24 '22 20:06 ianklatzco