Tuesday, August 15, 2017

Dev Tips: DevTools: Better JavaScript logging with the Log Management UI ✅

Dev Tips

 

DevTools:  Better JavaScript logging with the Log Management UI

 

I'm going to publish a free ModernDevTools.com lesson to YouTube soon. Subscribe to show your interest & get notified!


The new Log Management UI is a hidden experimental feature in Canary DevTools. Once enabled, you can create console.log functions which have their own context.

After you enable the experiment, try this snippet of code in the Console Panel to use the Log Management UI:
 

const thirdPartyLogger = console.context('3rd Party')  const infoLogger =  console.context('Info')  const requestsLogger =  console.context('Requests');    thirdPartyLogger.log('Something about a third party script')  infoLogger.log('An information log')  infoLogger.log('The log management UI helps group this')  infoLogger.log('This is experimental, in Canary! 🆕')  fetch(location.href).then(requestsLogger.log)      

Logs join different categories which you can navigate through. This helps decrease the noise when viewing many logs which are all combined into one section.


If you have any troubles viewing this animated gif, check out: umaar.com/dev-tips/153-log-management
Tweet
Share
+1
Email Marketing Powered by MailChimp

Copyright © 2017 Umar, All rights reserved.
You are receiving this email because you signed up for Dev Tips.

unsubscribe from this list    update subscription preferences 

No comments:

Post a Comment