Hi all,

Is there a way to automatically send say a prefix string with many already
coded logger invocations?

For example, to go from:

------------------------------------
(thread
...
(log-debug "information specific to particular thread, without mention of
which thread"))
------------------------------------

to:

------------------------------------
(thread
...
(parameterize ([current-logger-prefix "thread identifier"])
...
(log-debug "information specific to particular thread, without mention of
which thread")))
------------------------------------

where the latter log-debug is defined to do (format "~a: ~a"
(current-logger-prefix) message).

Since the receiver is in a different thread, directly coding a receiver to
use the parameter won't work. And since it's asynchronous, relying on
globals won't work.

The use case if somebody has a different idea altogether is a webserver
supporting multitenancy. The request handler for tenant "X" should log as
"X: <original log string>".

It looks like this would be easy to add to racket/private/logger if there's
no way short of mass refactoring, so it's not hopeless.

-- 
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