[Swan-dev] pexpect() and passert() from a thread

Andrew Cagney andrew.cagney at gmail.com
Fri Aug 21 17:10:22 UTC 2020


FYI,
Currently if there's a pexpect() or passert() in a helper thread
there's no context (state prefix) so it's not easy to proportion
blame.  Going forward (when cur_* are deleted) the main thread will
have the same problem.
However, with loggers pretty much available everywhere, its possible
to pass the logger into these macros.  I'm wondering about the best
strategy ... so I'll throw out two suggestions:

Plan A)
rename pasert() - passert_global() (or PASSERT? or ...)
add passert(LOGGER, CONDITION) (or is that passert(CONDITION, LOGGER)
this way the familiar name remains, but it gains a parameter

Plan B)
add new PASSERT(LOGGER, CONDITION) and leave existing passert() alone
I suspect new code will continue to use the old passert()

Plan C)
some combination of the above


More information about the Swan-dev mailing list