I use a modified version of tools.trace (or rather the old version
called clojure.contrib.trace, but works with 1.3), you might be
interested in some of the additions (sorry not well doc'd at the
moment):

1) Don't blow up if a function throws an exception (return value shown
in the trace will be the exception object).
2) option to trace a multi-threaded app - output is to a separate file
for each thread
3) Trace entire namespaces, multiple namespaces, exclude fn's from
traced namespaces.
4) ability to pretty print the trace to html with syntax highlighter.

1 &3 are probably the only ones useful at the repl.

Jeff
https://github.com/weissjeffm/fn.trace/

On Dec 30, 11:52 am, Erlis Vidal <er...@erlisvidal.com> wrote:
> Hi Jonas,
>
> That's what I was looking for. Thanks for your reply
>
>
>
>
>
>
>
> On Fri, Dec 30, 2011 at 8:16 AM, Jonas <jonas.enl...@gmail.com> wrote:
> > You should take a look at tools.trace [1]. A minimal example:
>
> >     (ns trc.core
> >       (:use [clojure.tools.trace :only [deftrace]]))
>
> >     (deftrace fib [n]
> >       (if (or (= n 0) (= n 1))
> >         1
> >        (+ (fib (- n 1)) (fib (- n 2)))))
>
> > the following is printed when (fib 4) is evaluated:
>
> > TRACE t2302: (fib 4)
> > TRACE t2303: | (fib 3)
> > TRACE t2304: | | (fib 2)
> > TRACE t2305: | | | (fib 1)
> > TRACE t2305: | | | => 1
> > TRACE t2306: | | | (fib 0)
> > TRACE t2306: | | | => 1
> > TRACE t2304: | | => 2
> > TRACE t2307: | | (fib 1)
> > TRACE t2307: | | => 1
> > TRACE t2303: | => 3
> > TRACE t2308: | (fib 2)
> > TRACE t2309: | | (fib 1)
> > TRACE t2309: | | => 1
> > TRACE t2310: | | (fib 0)
> > TRACE t2310: | | => 1
> > TRACE t2308: | => 2
> > TRACE t2302: => 5
>
> > [1]:https://github.com/clojure/tools.trace
>
> >  --
> > 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
> > Note that posts from new members are moderated - please be patient with
> > your first post.
> > 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

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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

Reply via email to