DEV Community

Discussion on: Say Goodbye to console.log from Production environment

Collapse
 
reduardo7 profile image
Eduardo Cuomo

What will happen when I use console.info() for example?

Thread Thread
 
visualjeff profile image
Jeff • Edited

Calling info() will cause an exception.

So a better approach would be to do the following if you are only interested in silencing console.log:

globalThis.console.log = () => {};
Enter fullscreen mode Exit fullscreen mode

It's helpful you called this out.