1.2.0 permalink Arrow_down_16x16

print-stack-trace

clojure.contrib.condition

  • (print-stack-trace x)
Prints a stack trace for a condition or Throwable. Skips frames for
classes in clojure.{core,lang,main} unless the *full-stack-traces* is
bound to logical true

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/condition.clj:128 top

(defn print-stack-trace
  "Prints a stack trace for a condition or Throwable. Skips frames for
  classes in clojure.{core,lang,main} unless the *full-stack-traces* is
  bound to logical true"
  [x]
  (let [[header frames cause] (stack-trace-info x)]
    (printf "%s\n" header)
    (doseq [frame frames]
      (let [classname (.getClassName frame)]
        (if (or *full-stack-traces*
                (not (re-matches
                      #"clojure.(?:core|lang|main).*" classname)))
          (printf "        at %s/%s(%s:%s)\n"
                  classname
                  (.getMethodName frame)
                  (.getFileName frame)
                  (.getLineNumber frame)))))
    (when cause
      (printf "caused by: ")
      (recur cause))))
Vars in clojure.contrib.condition/print-stack-trace: defn doseq let not or printf re-matches when
Used in 0 other vars

Comments top

No comments for print-stack-trace. Log in to add a comment.