I have a point in my clojure code where I want to know what the call stack was (ie: list of clojure functions used to get there). How can I do this?
This isn't the nicest solution, but it's simple and it should work in core clojure:
(try (throw (Exception. "")) (catch Exception e (.printStackTrace e *out*)))
You can inspect e in code if you want something other than a printed version. See also clojure.stacktrace in the current master branch or clj-stacktrace for clojure 1.2.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With