lisa.utils.subprocess_log#

lisa.utils.subprocess_log(cmd, level=None, name=None, logger=None, **kwargs)[source]#

Similar to subprocess.check_output() but merges stdout and stderr and logs them using the logging module as it goes.

Parameters:
  • cmd (str or list(str)) – Command passed to subprocess.Popen

  • level (int or None) – Log level to use (e.g. logging.INFO).

  • name (str or None) – Name of the logger to use. Defaults the the beginning of the command.

  • logger (logging.Logger) – Logger to use.

Variable keyword arguments:

Forwarded to subprocess.Popen.