How to log js stack trace with console.trace() but keep it collapsed

The answer was to use console.groupCollapsed();

    console.groupCollapsed('name to show to identify trace');
    console.log('additional data hidden inside collapsed group');
    console.trace(); // hidden in collapsed group
    console.groupEnd();

Which looks something like this in console. ( works in chrome, not sure of others )

enter image description here

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)