Console.log("something useful") -- performance?

Hey all, I have apps running on Meteor Galaxy and the logging is super helpful. Does this slow down the app at all?

If so, is there a global way to enable/disable?

Yes. Using console.log has quite a performance impact. You might not notice it when everything else is fast and there is just 1 console.log fired every minute or so. However, as soon as you run it a lot it will slow down your app significantly.

In fact, you shoulnt use console.log at all (at least not in production) since it has a lot of downsides (besides the performance impact). Read this: https://hackernoon.com/please-stop-using-console-log-its-broken-b5d7d396cf15

Also would recommend tools like Winston for logging and debug for local development.

2 Likes

Thanks pal, I’ll check it out.