Permalink
Browse files

Log shell exit code (for debugging)

  • Loading branch information...
1 parent 848d652 commit 9df6d99c381de7439376ebc955bd96be86d755b8 Yurii Rashkovskii committed Feb 19, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 apps/htoad/src/htoad_shell.erl
@@ -36,15 +36,15 @@ command_run_as_superuser(Engine, #shell{ cmd = Cmd, run_as = superuser } = Shell
lager:debug("Executing shell command as a super user (via sudo): ~s", [Cmd]),
{Code, Output} = htoad_shell_server:start(Shell#shell{ cmd = "/usr/bin/sudo -n " ++ Cmd }),
Result = adjust_output(Output, Shell),
- lager:debug("Shell output for `~s` (sudo): ~s", [Cmd,Result]),
+ lager:debug("Shell output for `~s` (sudo) (exit code ~w): ~s", [Cmd,Code,Result]),
htoad:assert(Engine, [{exit_status, Shell, Code}, {output, Shell, Result}]).
command(Engine, #shell{ cmd = Cmd, run_as = _ } = Shell) ->
lager:debug("Executing shell command: ~s", [Cmd]),
{Code, Output} = htoad_shell_server:start(Shell),
Result = adjust_output(Output, Shell),
- lager:debug("Shell output for `~s`: ~s", [Cmd, Result]),
+ lager:debug("Shell output for `~s` (exit code ~w): ~s", [Cmd,Code,Result]),
htoad:assert(Engine, [{exit_status, Shell, Code}, {output, Shell, Result}]).

0 comments on commit 9df6d99

Please sign in to comment.