问题
Is it possible to hide all console output from some scripts in Chrome's developer tools? Sometimes third-party libraries or APIs provide some information in console. That's OK, but can be very annoying when you want to debug your own code.
More simply, can I ask developer tools to hide console output from https://www.google-analytics.com/analytics.js
(just dummy example). Or even better, to show only error level for this source?
Yes, there are some ways. I can add a string marker to text which allows me to filter my messages. I can play around overriding console
instance... I wonder if there is such funtionality built in developer tools?
回答1:
Accidentally found a part of answer.
If you right-click on any message in console, there is Filter
item in context menu. And you can hide there messages from exact source.
Still wonder if there is possibility to set logging level per source.
来源:https://stackoverflow.com/questions/45737141/mute-scripts-in-chromes-developer-tools-console