Javascript 单击 Google Chrome 中的链接时停止清除控制台日志

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7124164/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 00:56:26  来源:igfitidea点击:

Stop the console log clearing when you click a link in Google Chrome

javascriptgoogle-chrome

提问by HM2K

Referred to as the "JavaScript console", when you click on a link, the log is cleared.

称为“JavaScript 控制台”,当您单击链接时,日志将被清除。

Is there a way to stop this log from being cleared when you click on a link?

当您单击链接时,有没有办法阻止清除此日志?

The problem is that an event triggered onClick is returning an error which makes it harder to diagnose because the error is only displayed for a short time before being cleared.

问题是触发 onClick 的事件返回了一个错误,这使得诊断变得更加困难,因为错误在被清除之前只会显示很短的时间。

Thanks.

谢谢。

回答by Boris Smus

This is an option in the developer tools. Right click the console, and select Preserve Log upon Navigation, or go through the settings menu (bottom right cog-looking icon in the devtools).

这是开发人员工具中的一个选项。右键单击控制台,然后选择Preserve Log on Navigation,或浏览设置菜单(开发工具中右下角的齿轮图标)。

pic

图片

回答by dsharew

Google Chrome Version: 65.0.3325.146 (Official Build) (64-bit)
Under the Networktab check Preserve Log

Google Chrome 版本:65.0.3325.146(官方版本)(64 位)
网络选项卡下检查保留日志

enter image description here

在此处输入图片说明

Google Chrome:Version 39.0.2171.95(64-bit)
Console -> Settings -> Preserver log enter image description here

Google Chrome:版本39.0.2171.95(64 位)
控制台 -> 设置 -> Preserver 日志 在此处输入图片说明

回答by katspaugh

enter image description here

在此处输入图片说明