From dd3c3eeb85afb321130d9270619334605d985fd1 Mon Sep 17 00:00:00 2001 From: jar3b Date: Fri, 12 Apr 2019 15:26:26 +0300 Subject: [PATCH] Add forceOutput parameter to yaml --- src/tasks/models.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tasks/models.go b/src/tasks/models.go index 6d11bb8..8e21ded 100644 --- a/src/tasks/models.go +++ b/src/tasks/models.go @@ -48,6 +48,7 @@ type Task struct { Deadline uint32 `yaml:"deadline"` UseSystemEnv *bool `yaml:"useSystemEnv,omitempty"` ConcurrencyPolicy string `yaml:"concurrencyPolicy"` + ForceOutput *bool `yaml:"forceOutput,omitempty"` // internal values envVars []string @@ -143,7 +144,11 @@ func (t *Task) Run() { select { case err := <-execution.stop: if err == nil { - log.Infof("[%-20s][%d] SUCCESS, took %v", t.Name, execution.id, time.Since(execution.time)) + if t.ForceOutput != nil && *(t.ForceOutput) == true { + log.Infof("[%-20s][%d] SUCCESS, took %v, output: %s", t.Name, execution.id, time.Since(execution.time), t.buf.String()) + } else { + log.Infof("[%-20s][%d] SUCCESS, took %v", t.Name, execution.id, time.Since(execution.time)) + } log.Debugf("[%-20s][%d] SUCCESS, output: %s", t.Name, execution.id, t.buf.String()) } else { log.Infof("[%-20s][%d] ERROR, took %v, err: %v, output: %s", t.Name, execution.id, time.Since(execution.time), err, t.buf.String())