question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Don't output `console.log`s in production (don't use console.log directly)

See original GitHub issue

Plotly.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.

open-tag

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
n-riescocommented, May 25, 2016

I was thinking of submitting a PR to replace all the occurrences of console.log under src/ with lib.log. Would that be OK?

0reactions
mdtuszcommented, May 25, 2016

😑 …

Yep.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found