mpas_tools.logging.check_call

mpas_tools.logging.check_call(args, logger, log_command=True, **kwargs)[source]

Call the given subprocess with logging to the given logger.

Parameters
  • args (list) – A list of argument to the subprocess

  • logger (logging.Logger) – The logger to write output to

  • log_command (bool, optional) – Whether to write the command that is running ot the logger

  • kwargs (dict) – Keyword arguments to pass to subprocess.Popen

Raises

subprocess.CalledProcessError – If the given subprocess exists with nonzero status