Skip to content

Commit 1a0628f

Browse files
vladakVladimir Kotal
authored andcommitted
always log command output as INFO
1 parent a21b2ce commit 1a0628f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tools/sync/hook.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ def run_hook(logger, script, path):
3434
Return 0 on success, 1 on failure.
3535
"""
3636

37+
ret = 0
3738
logger.debug("Running hook '{}' in directory {}".
3839
format(script, path))
3940
cmd = Command([script], work_dir=path)
4041
cmd.execute()
4142
if cmd.state is not "finished" or cmd.getretcode() != 0:
42-
logger.error("failed to execute {}".format(cmd))
43-
logger.error(cmd.getoutputstr())
44-
return 1
43+
logger.error("command failed: {} -> {}".format(cmd, cmd.getretcode()))
44+
ret = 1
4545

46-
logger.info(cmd.getoutputstr())
46+
logger.info("command output:\n{}".format(cmd.getoutputstr()))
4747

48-
return 0
48+
return ret

0 commit comments

Comments
 (0)