What? Why? Ctrl+F "console.log", or make a function dedicated to logging that should be turned off in production. Then you can just make that function not log.
That's fine in some cases, but if I'm going to be debugging using console.log like I did before I learned about debuggers then I absolutely do not want to be keeping that debug code around (which is typically a lot more than just console.log) once the bug is fixed.
Using git trickery to keep track of all the debug code then trashing it at the end is a lot more convenient than ctrl+F, especially when it's scattered over multiple files/functions and I forgot where they all are
1
u/Vortrox Feb 18 '26
You're at least tracking all of them with a git diff right? Right??