Starting with node v8.0.0 and prior to v8.10 and v10.x (depending on the specific method), the global console exposed many of the same methods that are exposed in browsers, but did not document their existence or behavior. Such methods include:
console.debug console.dirxml console.markTimeline
console.profile console.profileEnd console.table
console.timeStamp console.timeline console.timelineEnd
The implementation for these methods were not in node (they did not appear in lib/console.js); they were added by V8 itself and were copied onto node's global console object.
As you've observed, calling these methods did not result in anything going to stdout. Instead, output goes to any attached inspectors.
This means you have to run node with the --inspect flag, open Chrome and go to chrome://inspect, then attach the inspector to your process. You will see the output of the extended console methods in the inspector's console.
Keep in mind that by default, the inspector console filters out calls to console.debug. You need to click the levels dropdown and check Verbose in order to see console.debug output.
Alternatively, you could:
- In node v8.0-8.9, do something like
console.debug = console.log if you just want to see output on stdout
- update to node v8.10
As of v8.10.0, the console.debug method is implemented by node and its output appears on stdout. The GUI inspector retains its behavior (messages are hidden unless you change the logging level).
node v10.x implements many of the other methods listed above, which means these methods are now work as expected (ie show up on stdout) and are documented.