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.

Why disable `console.log`?

See original GitHub issue

I’m a fan of most of what I see, but I don’t particularly understand the decision to disallow console.log. I can understand the “it has no place in production” argument, but I also wouldn’t want my linter constantly complaining in a development environment.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:5
  • Comments:19

github_iconTop GitHub Comments

5reactions
kasperpeulencommented, Sep 12, 2016

I don’t understand this rule. I thought console.debug was meant for debugging, messages that should be removed later.

But why would there be no place for console.info or console.warn in production apps?

For example create react app uses console.warn to show eslint warnings in the console.

2reactions
ljharbcommented, Dec 16, 2015

linters are typically run as part of tests. in development, while you might integrate them into an IDE or editor, that just means the console.log line will have a helpful error next to it reminding you to clean it up.

Alternatively, you could use the actual debugger for development.

Please feel free to fork the style guide and change any rules you like!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to quickly and conveniently disable all console.log ...
How to use the above 'logger'? In your ready event, call logger.disableLogger so that console messages are not logged. Add calls to logger.enableLogger...
Read more >
Deactivate console.log on production (Why and How) - Medium
When debugging or making sure APIs or other resources are working well, we tend to log a lot of information into the console,...
Read more >
Hide all console logs in production with just 3 lines of code
So in your overall JavaScript window / class / enclosure just set the variable AppDebug to true to log everything, or leave it...
Read more >
JavaScript Disable console.log on Production Environment
In JavaScript applications, especially on Frontend apps, we might want to disable our console.logs that are placed for debugging.
Read more >
The simplest way to disable console.log for Production build in ...
The simplest way to disable console.log for Production build in Angular? · By using libraries such as logger · Creating a linting rule...
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