console.error hides stack traces by default, showing only the user-logged errors string:

This is great because it reduces clutter in the console and makes it easier to scan for a particular message before digging in.
It would be fantastic if the console API exposed a similar opt-in behavior to developers (particularly framework developers) enabling us to define collapsable substrings within a logged message.
As just one example- React could make immediate use of this with our "component stacks" feature. A React DEV warning may currently look something like this:
Warning: Each child in a list should have a unique "key" prop.
Check the render method of List. See https://fb.me/react-warning-keys for more information.
in ListItem (at List.js:20)
in List (at Example.js:7)
in Example
With an API like the one I'm describing, maybe it could instead look like this.
Warning: Each child in a list should have a unique "key" prop.
▸ Check the render method of List.
See https://fb.me/react-warning-keys for more information.
Even if an API like this was limited to only allow for one collapsable string at the end, this would still be an improvement for e.g. large "component stacks"
Warning: Each child in a list should have a unique "key" prop.
See https://fb.me/react-warning-keys for more information.
▸ Check the render method of List.
Doesn't groupCollapsed do this?
groupCollapsed provides some similar functionality:

Unfortunately groupCollapsed has a major downside: group logs can never be filtered from a console, which makes them more expensive/noisy.

This feature request is loosely related to #163.
console.errorhides stack traces by default, showing only the user-logged errors string:This is great because it reduces clutter in the console and makes it easier to scan for a particular message before digging in.
It would be fantastic if the console API exposed a similar opt-in behavior to developers (particularly framework developers) enabling us to define collapsable substrings within a logged message.
As just one example- React could make immediate use of this with our "component stacks" feature. A React DEV warning may currently look something like this:
With an API like the one I'm describing, maybe it could instead look like this.
Even if an API like this was limited to only allow for one collapsable string at the end, this would still be an improvement for e.g. large "component stacks"
Doesn't
groupCollapseddo this?groupCollapsedprovides some similar functionality:Unfortunately

groupCollapsedhas a major downside: group logs can never be filtered from a console, which makes them more expensive/noisy.This feature request is loosely related to #163.