I was just now coding something similar (to add info like `port-next-location` to errors and warning logging).  Ideas:

1. If changing the module with the logging forms is practical, and you just don't want the changes to be too messy, you could make syntax that expands to the logging syntax:

(define-logger somemodule)
(define-syntax log-somemodule-debug/foo
  (log-with-foo-syntax log-somemodule-debug))
;;...
(log-somemodule-debug/foo "aaa ~S" bbb)
;;=expand=>
(log-somemodule-debug "~S: aaa ~S" (current-foo) bbb)
;; current-foo is a parameter within your thread.
;; if the format string wasn't a literal, expand would use string-append.

2. I don't know offhand whether this works, and I'm not sure of the overhead: using `current-logger` and `make-logger` (with its topic argument for your thread ID), something like:

(define (my-thread-proc foo)
  (parameterize ((current-logger (make-logger foo
                                              (current-logger)
                                              ...OTHER...)))
    ...THREAD-BEHAVIOR...))

3. There's now a `with-intercepted-logging` form, which might let you do what you want.

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to