Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think this post should go into more detail about why this works. As written, this simply looks like you're just calling the exact same method with a different name. The thing that makes it work is that by wrapping it in an extra method, you're effectively adding the prior method (i.e.: the one you want included in the stack trace) to the list maintained by `caller`. Thus, when you call `backtrace`, you'll be able to see the method from which it was called.


Good feedback; I think a couple of example backtraces would help to illuminate what's going on. Not sure if I'll edit this post, but I shall take it to heart for future ones. Thanks!




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: