Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make console.group output to debug or info instead of log?

I try to keep console.log clean so I use console.debug and console.info when possible but how can I make it so that console.group logs to info or debug. It keeps putting an empty group in log. I don't see any option to change it to output somewhere else.

like image 471
Brennan Cheung Avatar asked Dec 20 '25 09:12

Brennan Cheung


1 Answers

As best I can tell, it's not specifically meant to work that way according to the specification (which is more concerned with interactivity and is light on other details):

https://console.spec.whatwg.org/#grouping

In practice, a group can contain different types of output (so for instance, info and debug) so I think the intention here is to make groups useful to specific actions (so group all this console output for this function) so having a group header that is always visible makes some sense. Not sure if that is helpful.

like image 180
Katharine Osborne Avatar answered Dec 21 '25 21:12

Katharine Osborne



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!