Add command to stdout/stderr log.
This commit is contained in:
parent
8cfa1c37d0
commit
7a3c6f2024
3 changed files with 7 additions and 7 deletions
|
@ -254,8 +254,8 @@ class Local(object):
|
|||
output = None
|
||||
|
||||
if do_save_output:
|
||||
util.log_std_fd(self.log, stderr, 'Local stderr')
|
||||
util.log_std_fd(self.log, stdout, 'Local stdout')
|
||||
util.log_std_fd(self.log, command, stderr, 'Local stderr')
|
||||
util.log_std_fd(self.log, command, stdout, 'Local stdout')
|
||||
|
||||
return output
|
||||
except subprocess.CalledProcessError as e:
|
||||
|
|
|
@ -335,8 +335,8 @@ class Remote(object):
|
|||
stderr=stderr)
|
||||
output = None
|
||||
|
||||
util.log_std_fd(self.log, stderr, 'Remote stderr')
|
||||
util.log_std_fd(self.log, stdout, 'Remote stdout')
|
||||
util.log_std_fd(self.log, command, stderr, 'Remote stderr')
|
||||
util.log_std_fd(self.log, command, stdout, 'Remote stdout')
|
||||
|
||||
return output
|
||||
except subprocess.CalledProcessError as e:
|
||||
|
|
|
@ -169,8 +169,8 @@ def get_std_fd(base_path, name):
|
|||
return stdfd
|
||||
|
||||
|
||||
def log_std_fd(log, stdfd, prefix):
|
||||
def log_std_fd(log, command, stdfd, prefix):
|
||||
if stdfd is not None and stdfd != subprocess.DEVNULL:
|
||||
stdfd.seek(0, 0)
|
||||
log.trace("{}: {}".format(
|
||||
prefix, stdfd.read().decode()))
|
||||
log.trace("Command: {}; {}: {}".format(
|
||||
command, prefix, stdfd.read().decode()))
|
||||
|
|
Loading…
Reference in a new issue