phw / musicbrainz-magic-tagger-button

Browser user script to automatically enable the green tagger button on musicbrainz.org
MIT License
9 stars 1 forks source link

Remove verbose debug info from console Error level #5

Closed jesus2099 closed 9 months ago

jesus2099 commented 1 year ago

Because of this line:

https://github.com/phw/musicbrainz-magic-tagger-button/blob/77c491aee301447ced341aba19d850e749a40869/mb-magic-tagger-button.user.js#L119

I get my JavaScript console cluttered by 11 big fake errors on each MB page loading. Tt is making my userscript dev life not easy. I have commented out this line in the meantime.

MusicBrainz Magic Tagger Button.user.js:82  [Magic Tagger Button] Error: Request failed GET http://127.0.0.1:8007: 0 
    at errorHandler (MusicBrainz Magic Tagger Button.user.js:119:14)
    at HttpRequested (injected-web.js:1:6271)
    at Object.onHandle (injected-web.js:1:3124)
    at injected-web.js:1:13985
    at nt.post (injected.js:1:9592)
    at HttpRequested (injected.js:1:11900)
    at injected.js:1:5324
    at p (injected.js:1:2721)

The userscript not finding MusicBrainz Picard is part of the normal behaviour of the script, it should be in debug level, and should not appear in console, with default settings (not showing debug level). I say debug, not log because it is big and 11 times per page. :)

Additionally maybe if you could add a const DEBUG = false and debug only when you locally set it to true, could be a bonus.


Sorry no PR because I don't know Promise.

phw commented 9 months ago

I changed the output from warning to debug.

Additionally maybe if you could add a const DEBUG = false and debug only when you locally set it to true, could be a bonus.

You can disable debug logging in the browser console. That's much easier then having to go into a script and set a variable to false. Also if you really want to not log this at all and edit the script anyway you can also disable the debug line completely.

jesus2099 commented 9 months ago

Thank you very very much! 😁👍