Skip to content

Commit deab9a8

Browse files
committed
[executor] Ensure correct log level for task stdout/stderr
1 parent 584cb8d commit deab9a8

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

executor/executable/basictask.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ func (t *BasicTask) makeTransitionFunc() transitioner.DoTransitionFunc {
5959
var errStdout, errStderr error
6060
var stdoutBuf, stderrBuf bytes.Buffer
6161

62-
stdoutLog := log.WithPrefix("task-stdout").WithField("task", t.ti.Name).Writer()
63-
stderrLog := log.WithPrefix("task-stderr").WithField("task", t.ti.Name).Writer()
62+
stdoutLog := log.WithPrefix("task-stdout").WithField("task", t.ti.Name).WriterLevel(logrus.DebugLevel)
63+
stderrLog := log.WithPrefix("task-stderr").WithField("task", t.ti.Name).WriterLevel(logrus.ErrorLevel)
6464

6565
// Each of these multiwriters will push incoming lines to a buffer as well as the logger
6666
stdout := io.MultiWriter(stdoutLog, &stdoutBuf)

executor/executable/controllabletask.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (t *ControllableTask) Launch() error {
8080
_, errStdout = io.Copy(log.WithPrefix("task-stdout").WithField("task", t.ti.Name).WriterLevel(logrus.DebugLevel), stdoutIn)
8181
}()
8282
go func() {
83-
_, errStderr = io.Copy(log.WithPrefix("task-stderr").WithField("task", t.ti.Name).WriterLevel(logrus.DebugLevel), stderrIn)
83+
_, errStderr = io.Copy(log.WithPrefix("task-stderr").WithField("task", t.ti.Name).WriterLevel(logrus.ErrorLevel), stderrIn)
8484
}()
8585

8686
log.WithFields(logrus.Fields{

0 commit comments

Comments
 (0)