elemaudio / elementary

Elementary is a JavaScript library for digital audio signal processing.
https://www.elementary.audio/
MIT License
331 stars 29 forks source link

Error reporting #13

Closed cristianvogel closed 1 year ago

cristianvogel commented 1 year ago

It would be great to suggest to users some kind of less intense error reporting in the docs and in general. Accessibility concerns such as reduced movement etc should happen in the console too. When errors from the WASM get thrown, it can fire off console messages at some dizzy rate...

So far, I use stuff like;

        renderer.on('error', function (e: unknown) {
            console.error(`🔇 ${renderer.id} -> Error`);
            console.groupCollapsed('Error details ▶︎');
            console.log(e)
            console.groupEnd();
        });

but some awareness in the error emitter, like clustering, counting and grouping would be welcome I think

nick-thompson commented 1 year ago

When errors from the WASM get thrown, it can fire off console messages at some dizzy rate...

Ah, interesting! Can you share a brief log to explain what you're seeing? I feel like I haven't seen that myself

Accessibility concerns such as reduced movement etc should happen in the console too

What do you mean here?

cristianvogel commented 1 year ago

Well, it’s a minor thing I suppose. But let’s say - you put a console log in a snapshot callback , which is tracking a continuous signal. The logging will fill the console, and it’s hard to see other messages.You know what would be cool? A console logger that draws a little Lofi scope of in coming signal values. Essentially, the console is not designed for debugging signals.  And the browser debugging tools are also not appropriate as they pause execution—- 

Oh and the other point was a detail about considering users who prefer reduced movement on screen.

nick-thompson commented 1 year ago

Ah of course, logging continuous signals isn't as helpful as I want it to be either heh :). But in my opinion the library shouldn't log for you here, even if we manage to find a neat way to do it. If logging signals becomes part of how you want to debug/inspect/monitor your app I think it makes sense for you to find a way that works for you (which might not be the same for everybody or every application) rather than try to upstream a unified solution in the library.

nick-thompson commented 1 year ago

I'm going to close this as I think we're resolved here but please reopen if not!