Skip to content

Commit

Permalink
mysqlctl: Reduce logging for running commands (#13659)
Browse files Browse the repository at this point in the history
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
  • Loading branch information
dbussink authored Jul 28, 2023
1 parent 17a30a5 commit 8ea976d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions go/vt/mysqlctl/mysqld.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,6 @@ func (mysqld *Mysqld) Shutdown(ctx context.Context, cnf *Mycnf, waitForMysqld bo
// If input is not nil, pipe it to the command's stdin.
func execCmd(name string, args, env []string, dir string, input io.Reader) (cmd *exec.Cmd, output string, err error) {
cmdPath, _ := exec.LookPath(name)
log.Infof("execCmd: %v %v %v", name, cmdPath, args)

cmd = exec.Command(cmdPath, args...)
cmd.Env = env
Expand All @@ -586,10 +585,9 @@ func execCmd(name string, args, env []string, dir string, input io.Reader) (cmd
out, err := cmd.CombinedOutput()
output = string(out)
if err != nil {
log.Infof("execCmd: %v failed: %v", name, err)
err = fmt.Errorf("%v: %v, output: %v", name, err, output)
log.Errorf("execCmd: %v failed: %v", name, err)
err = fmt.Errorf("%v: %w, output: %v", name, err, output)
}
log.Infof("execCmd: %v output: %v", name, output)
return cmd, output, err
}

Expand Down

0 comments on commit 8ea976d

Please sign in to comment.