1.3.0 permalink Arrow_down_16x16

print-trace-element

clojure.stacktrace

  • (print-trace-element e)
Prints a Clojure-oriented view of one element in a stack trace.

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/stacktrace.clj:26 top

(defn print-trace-element
  "Prints a Clojure-oriented view of one element in a stack trace."
  {:added "1.1"}
  [e]
  (let [class (.getClassName e)
	method (.getMethodName e)] 
    (let [match (re-matches #"^([A-Za-z0-9_.-]+)\$(\w+)__\d+$" (str class))]
      (if (and match (= "invoke" method))
	(apply printf "%s/%s" (rest match))
	(printf "%s.%s" class method))))
  (printf " (%s:%d)" (or (.getFileName e) "") (.getLineNumber e)))
Vars in clojure.stacktrace/print-trace-element:
Used in 0 other vars

Comments top

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