This is an update to the console.log wrapper; see this blog post for background and a more detailed discussion of the problems with console logging.
While logging the console can be useful during development, some browser consoles do not display logged data in a readable, useful format. These primitive consoles do not expand arrays, do not link DOM elements to the source code, print objects as
[object Object] rather than listing their properties, etc.
For example, try logging the following in Internet Explorer 8 through 10:
It will result in:
By including the plugin and sending the data to
log(), the same call as above now looks like this:
It’s still not pretty, nor is it linkable like modern consoles. But now instead of
[object Object] you can see that it was an array (along with its length), or a DOM element (along with its selector), and so on. This can be useful in IE 7/8/9/10, iOS 5 and older, and Opera 11 and older, among others.
If you’re sticking to modern browsers, you can simply ignore the new
consolelog.detailprint.js plugin and continue to use
log() as usual.