I've always used loggers in their default form, where they send to the
terminal, and then I use tee if I want it to go to a file as well.  That's
easy and effective but there's got to be a better way.  Two questions:

1) Is there a way to change logger destinations from the environment such
that modifying the code isn't necessary?   (e.g. send it to a file instead
of the terminal)

2) Is there a way to make a log message go to multiple destinations at the
same time? (e.g. to the terminal and to a file)

My sense is that Racket is explicitly designed to not allow redirecting the
logs at runtime, since the documentation makes a point of saying that it
sends to the process's *original* error port.  Is that right?

It looks like I could get around this by manually creating log receivers,
syncing them in a separate thread, and manually processing the messages
that get pumped to them.  I could even have it poll the environment to
check for destination CLI arguments. That seems pretty kludgy and I thought
I'd ask for a better solution.


I've been through the command line section and the logging section of the
docs and am stumped.  If there's a relevant section of the FM that I missed
please point me.

https://docs.racket-lang.org/reference/running-sa.html#%28part._mz-cmdline%29
https://docs.racket-lang.org/reference/logging.html

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAE8gKodh2A2gE%3DbJ_DDJdRMN2B8LLnn%2BEHKPxU7oyM1XbS7TwA%40mail.gmail.com.

Reply via email to