Node.js & io.js tracing and debugging

By: Acamica

6   0   442

Uploaded on 12/09/2015

Driven by the tracing working group, io.js is adding features to make it easier to trace code execution. The latest v8, which is part of io.js added numerous hooks that enable us to bridge the gap between C/C++ and JavaScript code in order to debug and inspect it across those layers. Even until we can fully leverage all these new features numerous modules on npm make some of this available to us today. In this talk Thorsten Lorenz, @thlorenz, will show practical examples of both what is possible today and what’s coming in the near future.

----------------------------------------­---------------------------------------------
Encuentra esto y mucho más, en http://acamica.com

¡Suscríbete a Acamica!
Facebook: http://bit.ly/acamicaFB
Twitter: https://twitter.com/acamica_com
YouTube: http://bit.ly/AcamicaYTB

Comments (2):

By anonymous    2017-09-20

A lot of great answers here, but I'd like to add my view (based on how my approach evolved)

Debug Logs

Let's face it, we all love a good console.log('Uh oh, if you reached here, you better run.') and sometimes that works great, so if you're reticent to move too far away from it at least add some bling to your logs with Visionmedia's debug.

Interactive Debugging

As handy as console logging can be, to debug professionally you need to roll up your sleeves and get stuck in. Set breakpoints, step through your code, inspect scopes and variables to see what's causing that weird behaviour. As others have mentioned, node-inspector really is the bees-knees. It does everything you can do with the built-in debugger, but using that familiar Chrome DevTools interface. If, like me, you use Webstorm, then here is a handy guide to debugging from there.

Stack Traces

By default, we can't trace a series of operations across different cycles of the event loop (ticks). To get around this have a look at longjohn (but not in production!).

Memory Leaks

With Node.js we can have a server process expected to stay up for considerable time. What do you do if you think it has sprung some nasty leaks? Use heapdump and Chrome DevTools to compare some snapshots and see what's changing.


For some useful articles, check out

If you feel like watching a video(s) then

Whatever path you choose, just be sure you understand how you are debugging

enter image description here

It is a painful thing
To look at your own trouble and know
That you yourself and no one else has made it

Sophocles, Ajax

Original Thread

Popular Videos 355

Submit Your Video

If you have some great dev videos to share, please fill out this form.