Don't output `console.log`s in production (don't use console.log directly)
See original GitHub issuePlotly.js uses raw console.log
statements to print info, warning, and error messages. Instead, it should use an abstract logger so we can silence warnings in production. Something like https://github.com/FormidableLabs/abstract-log that lets us configure a null
transport in production for anything but errors.
As an example of this happening, try typing some HTML into the rich annotations editor. Before you’ve closed the opening tag, svg_text_utils.js
spews errors for every update.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Should I be removing console.log from production code?
If production code is to be fully optimized, logging will have to be removed to reduce the size of javascript being sent to...
Read more >Do not put console.log into version control or production.
The solution: Write a logging utility that wraps console. Do not push direct calls to console.log() into version control or into production code ......
Read more >Hide all console logs in production with just 3 lines of code
We basically use the console.log() in our JS application to check wether our code is working properly or to replicate the bug or...
Read more >Should you use a logging framework or console.log() in Node?
While browsers implement console differently, in Node the console module will print to stdout and/or stderr . If you're using console.log() it will...
Read more >Deactivate console.log on production (Why and How) - Medium
My advice is therefore either go through your code properly and remove all the console.log(…)s within your code-base or just deactivate it at ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was thinking of submitting a PR to replace all the occurrences of
console.log
undersrc/
withlib.log
. Would that be OK?😑 …
Yep.