def cmd_log(cmd, cwd):
 output = subprocess.check_output(cmd, cwd=cwd, stderr=subprocess.STDOUT)
 log.debug('Command was: {0!r}. Working directory was: {1!r}'.format(' '.join(cmd), cwd))
 log.debug('Command output was: {0!r}'.format(output))
 return output

def cmd_log ( cmd , cwd ) : output = subprocess . check_output ( cmd , cwd = cwd , stderr = subprocess . STDOUT ) log . debug ( 'Command was: {0!r}. Working directory was: {1!r}' . format ( ' ' . join ( cmd ) , cwd ) ) log . debug ( 'Command output was: {0!r}' . format ( output ) ) return output
helper function to redirect stderr to stdout and log the command used along with the output .