Search code examples
javascriptgoogle-chromegoogle-chrome-extensiongoogle-chrome-devtools

Chrome debugger - how to turn off console.log message grouping?


Say, in my Google Chrome extension I do this:

console.log(msg);

and the Chrome debugger groups similar messages like so:

enter image description here

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


Solution

  • 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:

    enter image description here

    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.