Hacker News new | ask | show | jobs
by throwaway808080 2650 days ago
I worked on Browser devtools. The #1 used tool was console. Nothing beats being able to put some console.log and see its output. Console.warn is even better since it captures the stacktrace.

Logs give a timeline of change.

I had this idea of console.snap but never got around to it. The idea is that it would not only capture the stacktrace, but a shallow copy of scopes at every function. You can query the snap to see how a variable changed, or find what set of variables caused something else to change later on.

I feel like this is the holy grail of debugging. Smarter logs that you can reason with and do time travel analysis.

I never got around to doing it, but now working at an analytics company, I see it being very valuable as it saves so much guess work.

1 comments

I totally agree - I love the ability in python to print out the stack trace, I use it all the time! I would love if that also had variables as well (although, this is tricky, because you have to worry about cycles between the variables if you are trying to print everything out. Maybe a list of variables to print out with the stack trace would be enough?)
That’s why I suggested a shallow copy