Joined October 2018
·
Posted to
Use console.error() instead of console.trace()
over 1 year
ago
This was driving me crazy, and console.error makes it hard to see real errors if there are lots of trace logs. so after a lot of messing around I came up with this.
javascript
console.groupCollapsed('name for trace', 'additional data to show');
console.log('data to hide in the collapsed group');
console.trace(); // trace to hide in group
console.groupEnd();
That produces something like
Formatting was messed up, trying again
javascript console.groupCollapsed('name for trace', 'additional data to show');
javascriptconsole.log('data to hide in the collapsed group');
javascript console.trace(); // trace to hide in group
javascriptconsole.groupEnd();
```
That produces something like
Inline-style: