Chrome调试器 - 如何关闭console.log消息分组? [英] Chrome debugger - how to turn off console.log message grouping?

查看:302
本文介绍了Chrome调试器 - 如何关闭console.log消息分组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Google Chrome扩展程序中,我这样做:

  console.log(msg); 

并且Chrome调试程序将类似的消息分组如此:





是有没有什么可以关闭它们,并将消息发布到原来的位置?

它只会折叠相同的连续行,我不认为这是一个问题,但是通过控制台右上角的设置按钮,您可以启用'显示时间戳',这会将它们放在不同的行上:




你可以看到他们只用这个方法折叠连续重复:

  msgs = ['hello','world','there'] ; (i = 0; i <20; i ++)console.log(msgs [Math.floor((i / 3)%3)])
pre>

控制台API 有很多其他功能可能会帮助您遵循您的代码。例如 console.count(label)记录标签记录了多少次记录, console.group()可以将其他日志记录调用分组在一起,并且 console.timeline(label)可以将日志分组到一个时间表中。


Say, in my Google Chrome extension I do this:

console.log(msg);

and the Chrome debugger groups similar messages like so:

Is there any any to turn it off and have messages post just as they are?

解决方案

It only collapses consecutive rows that are identical, I don't see it as much of a problem, but with the settings button in the top right corner of the console you can enable 'Show timestamps' which will put them on different lines:

You can see they only collapse consecutive duplicates with this:

msgs = ['hello', 'world', 'there'];
for (i = 0; i < 20; i++) console.log(msgs[Math.floor((i/3)%3)]) 

The console api has a lot of other functions that might help you follow your code. For instance console.count(label) logs label with a count of how many times it's been logged, console.group() lets you group other logging calls together and console.timeline(label) lets you group logs into a timeline.

这篇关于Chrome调试器 - 如何关闭console.log消息分组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆