Java methods are described with the usual name.space.ClassName.methodName convention and Clojure functions with their own name.space/function-name convention.
Anonymous clojure functions are denoted by adding an [fn] to their enclosing, named function.
"Caused by" cascades are shown as in regular java stack traces.
Elements are vertically aligned for better readability.
Printing is directed to *out*.
If you want to direct the printing to somewhere other than *out*, either use pst-on to specify the output location or pst-str to capture the printing as a string.
The library also offers an API for programatically 'parsing' exceptions. This API is used internal for pst and can be used to e.g. improve development tools. Try for example:
(use 'clj-stacktrace.core)
(try
("nofn")
(catch Exception e
(parse-exception e)))
Leiningen
If you use Leiningen, you can install clj-stacktrace on a per-user basis.user-wide basis. Just add the following to ~/.lein/profiles.clj:
For Leiningen 2.x, add the following to ~/.lein/profiles.clj:
The hook will enable clj-stacktrace to be used across all the projects you work on in clojure.test and other things that use the clojure.stacktrace library. The :repl-options settings will cause clj-stacktrace to be used in the repl and swank tasks.
The :injections clause replaces the built-in stack trace printing with enhanced clj-stacktrace version; you can leave it out if you plan on invoking clj-stacktrace functions directly or are using tools which are already clj-stacktrace-aware.
0 comments on commit
6ca09a2