You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Log to the console — even legacy browsers without a console. Just pass any data to log() and you'll see it printed clearly and well-structured in the console.
If the browser doesn't have a console, Firebug Lite will load. You can pass any variable type: strings, objects, arrays, functions, etc.
Whether to append the actual line number to each log. Not supported by all browsers.
group (Boolean or object)
Groups the arguments for each log together
collapsed: true will collapse each group (in browsers that support collapsing)
label: "some string" sets the label or name for the groups
Simply setting group: true is a shorthand way of selecting the defaults
Detail Print
This is an optional plugin to provide help information about the data that is being logged, especially in IE and older browsers. Just include consolelog.detailprint.js along with consolelog.js.
Firebug, WebKit's Developer Tools, and Opera's Dragonfly print useful, interactive items to the console. For example:
console.log("Here's a string",3.14,{"alpha": 5,"bravo": false},document.getElementById('charlie'),newDate());
Results in:
Some browsers that have a primitive console — one that does not expand arrays, does not link DOM elements to the source code, only prints objects as [object Object] rather than listing their properties, etc.
Some cannot accept multiple arguments to a single console.log call. This includes IE 7/8/9/10, iOS 5 and older, and Opera 11 and older, among others.
Using the detailPrint companion plugin, special objects are presented in a more readable manner.