6

I want to use console.group/groupEnd in a snippet, but calls to them seem to be ignored.

console.group("my group");
console.log("foo");
console.groupEnd();

4
  • 3
    It might be that the console logging is still nascent and this use case hasn't been fully explored.
    – Makoto
    Jan 5, 2017 at 5:53
  • 2
    Those calls still work in your dev console, by the way. Just not in the snippet console. Same for console.table.
    – Cerbrus
    Jan 5, 2017 at 12:17
  • 1
    console.log([1,2,3,4,5,6,7]) and console.dir([1,2,3,4,5,6,7]) produces the same results as well.
    – roberrrt-s
    Jan 5, 2017 at 13:00
  • I don't think it is meant to be a full featured console. If it were, they would just throw firebug lite in there and be done with it.
    – user4639281
    Jan 5, 2017 at 20:00

1 Answer 1

1

See http://stacksnippets.net/scripts/snippet-javascript-console.js

The only methods supported by the snippet console are

  • console.log
  • console.warn
  • console.info
  • console.error
  • console.assert
  • console.dir
  • console.clear
  • console.time
  • console.timeEnd
  • console.config

Other method calls will be only native (if supported by the browser).

Some months ago I also proposed some improvement to the snippet console, I even provided the code. But it seems the team has no interest in improving it. I consider it feature-frozen.

3
  • I actually started rewriting the whole console in order to sandbox the console display from the demo DOM, communicating with everything via postMessage(). console.table() and console.group() are among several commands I added. I also started true parsing of format strings along with various other display improvements. I don't know... there's a lot in there and a lot left to do. So, it's not done -been busy... and it'll take some dev time on the SO side to change how they launch snippets -if they even decide it's worth it.
    – canon
    Jan 5, 2017 at 20:30
  • @canon No problem. You could start by merging pr #1 :D
    – Oriol
    Jan 5, 2017 at 20:46
  • oh, god... those are leftovers from when I was invoking Object.getOwnPropertyNames() back through the prototype chain to get everything.... not just enumerable properties.
    – canon
    Jan 5, 2017 at 22:12

You must log in to answer this question.