Stephen
Stephen

Reputation: 2570

In Chrome DevTools, can I turn off stacking of console.log messages?

I have Javascript code that loops through an array, and I have some quick console.log() calls that either prints "Not found" or "Found!" as the loop examines each element in the array for something.

I noticed that in the Chrome DevTools console tab, it stacks thee same console.log message together. For example, if the first 4 iterations of the loop result in "Not found" the console tab shows:

(4) Not found

Is there any way to see the console.log message as separate lines?

Upvotes: 1

Views: 1619

Answers (2)

Lahiru Chandima
Lahiru Chandima

Reputation: 24128

This can be done with "Group similar messages in console" checkbox in console settings.

enter image description here

Upvotes: 0

Ewan Jones
Ewan Jones

Reputation: 11

This was asked ages ago, but to anyone who finds this, the quickest and easiest way to do this is to add a TimeStamp to the log:

console.log("Found:" + new Date());

Upvotes: 1

Related Questions