Created
June 14, 2011 22:22
-
-
Save deobald/1026083 to your computer and use it in GitHub Desktop.
Get a meaningful clojure call stack from anywhere.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn ignored? [classname] | |
(let [ignored #{"callers" "dbg" "clojure.lang" "swank" "eval"}] | |
(some #(s/substring? % classname) ignored))) | |
(defn callers [] | |
(let [fns (map #(str (.getClassName %)) | |
(-> (Throwable.) .fillInStackTrace .getStackTrace))] | |
(vec (doall (remove ignored? fns))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For any internet denizens who wind up here, here's a working version of the
ignored?
function for Clojure 1.6: