Hi all, A little while ago I released clj-backtrace, a library that produces more readable backtraces for Clojure programs. I originally conceived of the library as just a better (.printStackTrace *e) for use at the REPL, but I've since found some other neat uses. I'd just like to share some screenshots and code that demonstrate these uses: perhaps they will catch your interest.
One use for clj-backtrace is better debugging output for errors that occur during unit tests. In the experimental clj-unit framework I use the parse-exception function to introspect on the stack trace, remove those elements that are at or below the test-running logic in the stack, and then use print-trace-elems to pretty-print the remaining, interesting stack elements. http://skitch.com/mmcgrana/byuuj/clj-backtrace-unit-tests http://github.com/mmcgrana/clj-garden/tree/master/clj-unit/src/clj_unit/console_reporter.clj Another use is debugging Clojure webapps. For example, I created some experimental "show exceptions" middleware for a webapp that catches exceptions that occur in the app code and shows a helpful stacktrace in the browser. http://skitch.com/mmcgrana/byu15/clj-backtrace-web-app http://github.com/mmcgrana/clj-garden/tree/master/cwsg/src/cwsg/middleware/show_exceptions.clj I also dump the stacktrace to the webapp's log, just like one would do at the REPL: http://skitch.com/mmcgrana/byuu6/clj-backtrace-logging If these examples seem interesting to you, I encourage you to check out the project page on GitHub: http://github.com/mmcgrana/clj-backtrace/tree/master I'd also be happy to answer any questions you have about using the library and to hear any general comments. - Mark --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---