[racket-users] New module log-bracketed; should probably be something else

2021-09-02 Thread David Storrs
I often find that for debugging I want to see a log message saying "I'm about to do X" followed by X followed by "I'm done with X" and I want it to return the result of X. I wrote this macro and posted it to the package server: https://pkgs.racket-lang.org/package/log-bracketed In retrospect, the

Re: [racket-users] New module log-bracketed; should probably be something else

2021-09-02 Thread Martin DeMello
I do like the second form better, especially since the actual code being run is not obscured by simply being the last argument to a long log function. martin On Thu, Sep 2, 2021 at 1:55 PM David Storrs wrote: > I often find that for debugging I want to see a log message saying "I'm > about to d

Re: [racket-users] New module log-bracketed; should probably be something else

2021-09-02 Thread Sorawee Porncharoenwase
Thoughts: - Perhaps the logger should be optional. The default value would be (current-logger). - The event name (like on-complete) could also be optional. The default would be the source location of the macro invocation site - Instead of “time: ~a”, I think it would be nice to supp

Re: [racket-users] New module log-bracketed; should probably be something else

2021-09-03 Thread David Storrs
On Thu, Sep 2, 2021 at 5:32 PM Sorawee Porncharoenwase < sorawee.pw...@gmail.com> wrote: > Thoughts: > >- Perhaps the logger should be optional. The default value would be >(current-logger). >- The event name (like on-complete) could also be optional. The >default would be the sour

Re: [racket-users] New module log-bracketed; should probably be something else

2021-09-23 Thread jackh...@gmail.com
This looks quite a bit like you're trying to implement tracing, which is like logging, but instead of emitting messages associated with *points* in time, you emit messages for *ranges* of time. Rust has an excellent library for tracing. Perhaps that will