[agent-go] fix-bugs

This commit is contained in:
zeaslity
2023-03-30 16:17:13 +08:00
parent 61481e7543
commit 3e9c95ed6d
2 changed files with 4 additions and 2 deletions

View File

@@ -63,6 +63,7 @@ func PipeLineCommandExecutor(pipeLineCommand [][]string) ([]string, error) {
prevCmd := cmds[i-1] prevCmd := cmds[i-1]
out, err := prevCmd.StdoutPipe() out, err := prevCmd.StdoutPipe()
if err != nil { if err != nil {
log.ErrorF("Pipeline command error happened! Command is => %v, Error is %v", partOfCommand, err)
return nil, err return nil, err
} }
cmd.Stdin = out cmd.Stdin = out

View File

@@ -67,8 +67,9 @@ func (l *Logger) Warn(msg string, fields ...zap.Field) {
} }
// Error logs an error message. // Error logs an error message.
func (l *Logger) Error(msg string, fields ...zap.Field) {
l.Logger.Error(msg, fields...) func (l *Logger) ErrorF(msg string, args ...interface{}) {
l.Logger.Error(fmt.Sprintf(msg, args...))
} }
// Fatal logs a fatal message and exits the program with a non-zero status code. // Fatal logs a fatal message and exits the program with a non-zero status code.