"You can't" is simpler, because the inevitable reply is "but how do I do actual logging inside g"

"Actual logging" as in direct access to IO?

Yes