Hey, I'm working on a small to medium sized, hopefully commercial product in clojure. I'll be providing an API to clients, and I'm also going to have to make some performance guarantees about a few of my functions. Because of that (as well as a few other reasons), I'm very interested interested in being able to log every little detail related to client interaction including call times for some critical functions.
In the past I would have defined a macro similar to clojure.contrib.trace/deftrace, let's say named defn-logging, that wrapped it's definition in the appropriate logging functions. Then I would have defined all my functions with defn-logging instead of defn. This is completely unfounded, but that doesn't strike me as being very clean. Am I justified in thinking this? I had one, probably very bad, idea of creating a separate namespace for the logging functions that simply pointed to their non-logging counterparts in the original namespace. I'm not sure if that's even possible without wrapping defn in a macro. Certainly, I think it'd be difficult to do cleanly. During Rich's "Clojure for Lispers" talks, he mentioned rebinding functions, and being able to use it for the purpose of logging. I think in my case, I'd need to do this globally some how to avoid using a macro like defn-logging. It's escaped me, how would I go about doing this? Is redefining global values like this a good idea? Any suggestions? Thanks, ~jeff --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---