DEV Community

Discussion on: Console.log Development vs Production

Collapse
 
lukeocodes profile image
@lukeocodes πŸ•ΉπŸ‘¨β€πŸ’»

You could also disable console.log in production?

console.log = function() {}
Enter fullscreen mode Exit fullscreen mode
Collapse
 
zainbinfurqan profile image
Zain Ahmed

Yes you can also define simple logic in app/root file and make console.log func to empty function, thanks for this suggestion.

Collapse
 
lukeocodes profile image
@lukeocodes πŸ•ΉπŸ‘¨β€πŸ’»

Ideally, you would use eslint to highlight them all. Then, before accepting the changes, go and remove them.

Thread Thread
 
zainbinfurqan profile image
Zain Ahmed

sorry didn't get your point

Thread Thread
 
lukeocodes profile image
@lukeocodes πŸ•ΉπŸ‘¨β€πŸ’»

Don't let console.log make it to production. Edit them out. eslint can read the code and warn you