Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I think I'm forgetting something...
If you forgot it's probably not that important...
console.error: (-_-) -
kamen69254yDo you have logs that are not on a new line? If not, you can skip the second step and just search for "\w?console.log".
-
@coffeeholic Oh, well if we get frameworks or process managers then I won't even bother to comment them...
pm2 start app.js --log /dev/null/ -
kjing1924yif you are a js dev, you can create an env file and do some flags or whatever you want to write about your logs. E.g.
window.__env.enableDebug = false;
and in your main.js you can do it like this
if (!env.enableDebug) {
window.console.log = function () { };
} -
kamen69254y@kjing It's possible, but not ideal. What if you're working on something that won't be alone in the global scope, i.e. an embeddable app/widget/something? You touch something in window and affect not only your app, but everything else too.
Related Rants
Getting ready for production.
Search: console.log
Replace: //console.log
Search: ////console.log
Replace: //console.log
...
Aaaaaand we're good.
rant
production
comment