Monday, May 8, 2017

console.log has many cousins!

console.log('log');
console.info('info');
console.debug('debug');
console.warn('warn');
console.error('error');

 
 

...will produce this at Google Chrome's Web Developer Tools' console:

 
 

Note the different themes for the different things. The warn and the error are expandable to show some metadata like the name of the JavaScript method that threw the error, etc. I've seen a StackOverflow thread that suggested that this too was legit:

console.exception('exception');

 
 

...and that it behaves just like console.error might, but for me console.exception causes an error in at Google Chrome's Web Developer Tools' console.

No comments:

Post a Comment