The lib.util.log code can be modified to look like atex/util/log.py to be usable natively with Python's logging module, and then split into multiple functions like util.debug(), util.info(), util.warning(), etc.
This is very useful for multiple levels of verbosity, allowing us to run with ie. info or warning during large productization runs, but override that with debug when debugging a single test.
This would allow us to see fine details like ssh key generation, virsh executions for starting up VMs, systemctl commands to query a service, etc. ... For example, the util.subprocess_* functions could take loglevel= argument rather than being "verbose vs silent" as now.
The code to set up console logging would be in lib/runtest.py and look like
logging.basicConfig(
level=logging.INFO,
stream=sys.stderr,
format='%(asctime)s %(name)s: %(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
)
(to simulate the output format we have now)
In that example, logging.INFO could come from some CONTEST_LOGLEVEL env var, or something like that, again checked in lib/runtest.py to avoid extra test code.
The
lib.util.logcode can be modified to look like atex/util/log.py to be usable natively with Python'sloggingmodule, and then split into multiple functions likeutil.debug(),util.info(),util.warning(), etc.This is very useful for multiple levels of verbosity, allowing us to run with ie.
infoorwarningduring large productization runs, but override that withdebugwhen debugging a single test.This would allow us to see fine details like ssh key generation,
virshexecutions for starting up VMs,systemctlcommands to query a service, etc. ... For example, theutil.subprocess_*functions could takeloglevel=argument rather than being "verbose vs silent" as now.The code to set up console logging would be in
lib/runtest.pyand look like(to simulate the output format we have now)
In that example,
logging.INFOcould come from someCONTEST_LOGLEVELenv var, or something like that, again checked inlib/runtest.pyto avoid extra test code.