Building a JavaScript Debugging Utility to Guard Noisy Production Consoles

Creating a function that wraps console.log() gives us a single point of control for all our logging needs, regardless of environment. Here is how I add this capability to any JavaScript project.

5 comments · 52% upvoted · source · other discussions

comments

csorfab

not js devs taking a literal 20+ year old idea and passing it off as their genius breakthrough with an AI slop article again 😭😭

HiKite

Frankly I'm much more interested how OP managed to have the "listen" button audio continue even after navigating to completely separate websites. 🤔

AndyMagill [OP]

Well, that's embarrassing. I've been working on a bug with that button, so it's likely misbehaving. Current code here : https://github.com/andymagill/dev.magill.next/blob/master/app/components/blog/ListenButton.tsx

KaiAusBerlin

Isn't that the way the JS eco system always was?

There are very few new things in the ecosystem. And most things needed are around for 10+ years.

So most advantages we see are old ideas with better performance and very little enchantments. Or unified standards in a new self set standard. Or things like "We took the best parts of X and Y and present you Z".

If you have a great idea in the js eco system that is "really useful" , chances are high that someone had this idea before and made it a library already.

dustofdeath

I just check env flag and noop the console output.

Actual errors etc get logged by grafana faro.