On Fri, Aug 2, 2019 at 5:49 PM Calvin Buckley <calvin@xxxxxxxxxx> wrote:
It's worth noting that the PASE libc "syslog" function (which Python
most likely wraps) will output to the system operator log, given enough
of a fatal condition.
Python does wrap `syslog`. Your C example would look like this in Python:
Unfortunately, this isn't the job log, but perhaps the right flags
passed to syslog will elicit something. I'd have to cross-reference
PASE specific documentation to be sure.
It's worth being aware of, and it could be handy for some folks, in
Mainly, I wanted something which the Python programmer wouldn't have
to specifically account for. That is, the Python code should ideally
look like regular, old, cross-platform Python code. "Normal Python
scripters" don't really use syslog, especially if they're on Windows.
The suggestion to make QSH send an escape message upon return code
other than zero pretty much nails my requirements, because unexpected
Python exceptions will result in a return code of 1. And this is
incredibly easy to implement. (Add one line to my
simplest-thing-that-could-possibly-work CLP Python wrapper.)
My super-nice-to-have feature would be for Python calls to be wrapped
in such a way that stderr (which is where the tracebacks go, by
default) goes into the text of a CPF9898. I got the feeling that
Richard's more elaborate Python wrapper could probably be adapted to