Clean / proper way to redirect stderr from psi4

Maybe this is a silly question…

I know I can use bash redirection to redirect stderr to a file but is there a clean way to redirect stderr output from psi4?

I (and I suspect many others!) run calculations on specific compute nodes, logging in, running the calculations backgrounded, and then monitoring the output file from a different computer. If a calculation dies for some reason, the output file may just end abruptly, because the errors have gone to stderr. If stderr “doesn’t exist”, then this output is lost.

I also seem to remember that at the end of an optimisation, “Optimisation complete” (or similar) is printed to stderr, and I’ve had calculations bail out in the past because it tried to print to stderr but couldn’t because it had been closed.

Is there a simple trick to redirect stderr from within a psi4 input script (rather than having to remember to redirect at the time of running it!)?

A psi4-way to set stderr is currently now available.

For supercomputers I see this less as an issue. Essentially all queuing systems offer to collect stderr for you. (Should be enabled by default on a good system IMO)

For psi4 1.4 we redirect several error messages into stdout that were in stderr before. So there is less reason to catch stderr.

Nonetheless, perhaps it is something to consider.