This is the subject of the bug-report from 2017
Issue 677929: DevTools: console.trace has expanded stack trace by default.
The bug was marked as fixed on 2018, then reported as being back
on 2019, marked as fixed again, reported as being back on 2019,
also reported by users as being still there on 2020 and 2021.
All these reports have not budged the bug status from
"Fixed (Closed)", so there is not much hope from
Chromium/Chrome.
You could try to open a new bug-report.
For a workaround, you could hide all messages from this source by
right-click on the little arrow in front of the trace and select
the option to hide all messages from this source.
For doing it in JavaScript, you could define your own
console.trace
. This workaround is suggested in another
bug-report on the same subject from 2017 whose
Status is "WontFix (Closed)"
Issue 697203: console.trace() expands automatically resulting in console bloat :
if(window.console && console.trace) {
var oldTrace = console.trace;
console.trace = function(msg) {
console.groupCollapsed(msg || 'trace');
oldTrace.apply(this);
console.groupEnd();
}
}
console.trace
with custom code (in the development environment only). I'm not sure if this approach can solve your problem, it's just an idea to explore.