ben
2021-2-3 22:07:52

Is there a way to tell if I’m in the background expander?

I want to write to a log during read-syntax. The writing fails during background expansion (because DrRacket sets a security guard). I can watch for the failure, but I’d rather not even try to write the log if I can.


laurent.orseau
2021-2-3 22:14:08

Does background expansion use a particular logger? If so you might be able to query it


ben
2021-2-3 22:27:06

yes — do I query by sending it a message?


laurent.orseau
2021-2-3 22:29:54

That may depend on the logger. Maybe you can register as a log receiver make-log-receiver and look for events


laurent.orseau
2021-2-3 22:31:43

or maybe log-level? can help also?


ben
2021-2-3 22:32:32

ok, thanks


laurent.orseau
2021-2-3 22:33:04

sorry, that’s rather exploratory, good luck :slightly_smiling_face:


samth
2021-2-4 02:36:14

Why not use Racket logging, and then redirect that to the log at a higher level?


ben
2021-2-4 03:15:58

that is a better idea, but I think I’ll have to wait until summer to do it


arthertz
2021-2-4 04:04:33

@arthertz has joined the channel