Transcript for:
Effective Console Logging Techniques in Node.js

what's up Wizards I've been going weirdly deep on Console logging recently and you're coming on this journey with me we've got this object here which is pretty deep here has a b CDE e all the way down to this big number down the bottom here and you can see that when we log it here we're basically it's kind of crapping out halfway through it's just printing out this object thing here and so console.log is not really doing the job we want it to we can wrap it in inspect from node util here so if we inspect the object by default that does nothing but if we add some extra things in here then if we add a depth modifier we can say depth is three now we're getting down to D what about if we go all the way down to four well we get our entire object that's nice but what if we want to go Infinity then we get the same result we can add a colors modifier here to add some extra color to the situation very nice a numeric separator to get some kind of nice numeric separator in here so we can actually see the numbers that are going on here there's some more stuff in here like Max array length Max string length things like this and if you don't want to import from util you can actually just get rid of this completely let me do a bit of bracket admin and then do console. deer and you get exactly the same result so this works really nicely in node