Skip to content

Instantly share code, notes, and snippets.

@hiredman
Created June 29, 2011 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiredman/1054566 to your computer and use it in GitHub Desktop.
Save hiredman/1054566 to your computer and use it in GitHub Desktop.
(defn- enable-trace [key f]
(let [traced-fn (trace-wrap key f)]
(println "tracing" key)
(alter traced-map assoc
key (struct-map traced-fn-struct :orig f :traced traced-fn))
(alter-var-root! (resolve key) trace-fn)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment