You're viewing version 1.2.0 of print-trace-element. The latest stable version of Clojure Core is 1.3.0.
1.2.0 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+$" 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: = and apply class defn let or printf rest
Used in 0 other vars

Comments top

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