Skip to content

Commit

Permalink
Merge pull request #43 from sjtug/wip-log-errors
Browse files Browse the repository at this point in the history
log errors when execution fails
  • Loading branch information
htfy96 authored Mar 6, 2018
2 parents 8f2c224 + cde2323 commit 56457e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions worker/rsync_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ func (w *RsyncWorker) RunSync() {
defer w.rwmutex.Unlock()
w.result = false
w.idle = true
w.logger.Infof("Stderr: %s", bufErr.String())
w.stderr.Put(bufErr.String())
w.logger.Debugf("Stdout: %s", bufOut.String())
w.stdout.Put(bufOut.String())
}()
continue
}
Expand Down
4 changes: 4 additions & 0 deletions worker/shell_script_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ func (w *ShellScriptWorker) RunSync() {
defer w.rwmutex.Unlock()
w.result = false
w.idle = true
w.logger.Infof("Stderr: %s", bufErr.String())
w.stderr.Put(bufErr.String())
w.logger.Debugf("Stdout: %s", bufOut.String())
w.stdout.Put(bufOut.String())
}()
continue
}
Expand Down

0 comments on commit 56457e7

Please sign in to comment.