开发者控制台过滤Error后仍显日志及空Action条目问题求助
Fixing Two Common Developer Console Log Issues
Hey there, let's break down solutions for your two console log problems—they're actually pretty common once you know where to look:
Problem 1: Error-filtered console still shows related messages
This usually happens for a few specific reasons—let's troubleshoot step by step:
- Verify the actual message type: Some logs might look like errors (styled red) but are actually
console.log()calls with custom CSS styling, not true browser-level Errors. Right-click the message, select "Copy message object", then paste it into the console to check itslevelproperty. If it's not set toerror, the default Error filter won't catch it. - Check the "Preserve log" toggle: If this option is checked, old logs from before you applied the filter will stick around. Uncheck it, refresh the page, and see if the unwanted messages disappear.
- Look for caught framework exceptions: Frameworks like React or Vue often catch internal exceptions and output custom logs that might bypass the default Error filter. Head to the "Sources" tab, check "Pause on exceptions" (including caught exceptions), trigger the issue, and trace where the log is coming from to adjust your code or framework settings.
Problem 2: Empty "action" entries still showing in "Errors only" mode
These empty "action" logs are almost certainly not actual errors—they're likely from misconfigured code or browser extensions. Try these fixes:
- Disable browser extensions: Third-party extensions (especially debug tools, ad blockers, or productivity add-ons) often sneak logs into the console. Disable all extensions, refresh, and if the entries vanish, re-enable them one by one to find the culprit.
- Filter out "action" keywords: Use the console's search bar with
-action(the minus sign excludes matches) to instantly hide all logs containing the word "action", even empty ones. - Audit your code's console calls: Search your project for
consolestatements, especially any tied to state management (like Redux actions) or custom logging utilities. Look for lines likeconsole.log("action", "")that might be outputting empty content. - Reset dev tool settings: If all else fails, right-click the console, select "Clear console history", then refresh. Or go to the dev tools settings panel and choose "Restore defaults and reload" to wipe any corrupted filter configurations.
内容的提问来源于stack exchange,提问作者Christian Neverdal
相关产品推荐
相关产品推荐

