Why disable `console.log`?
See original GitHub issueI’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:
- Created 8 years ago
- Reactions:5
- Comments:19
Top 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 >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 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
orconsole.warn
in production apps?For example create react app uses console.warn to show eslint warnings in the console.
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!