One technique I've used in the past for debugging is to open a UDP
port as a log stream and print messages to that stream. These messages
can be read at any time by a telnet connection to that port.

Since UDP packets that are not read just get dropped this is equivalent
to writing to /dev/null except when you want to watch what is begin
logged.

Since the values are printed they don't have to be kept.

You can even keep this live in a production environment for
dumping things like statistics. At Worldcom I used this to 
put up a "live console".

It might be possible to make a DEFTRACE macro to replace the DEFN
which prints the arguments and return values to the UDP port as in
   > enter (FOO "asdf" 3 'thing)
   < exit  (FOO 6)

When you connect to the UPD port you'll see an active trace, including
the arguments. If you set up a netcat listener on the port you can dump
the stream to a file and see the execution. If you're really slick you
can open a slime-like port to dump the trace to an emacs buffer.

Tim Daly


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to