X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/ea1d4703fbfb94f2632005bc570e65873c802b66..5cbcd7b2923a9c4e58189dbaa0b482e357291c57:/services/crunch-run/logging.go diff --git a/services/crunch-run/logging.go b/services/crunch-run/logging.go index 09b328a3cb..20928dbef7 100644 --- a/services/crunch-run/logging.go +++ b/services/crunch-run/logging.go @@ -35,6 +35,7 @@ type ThrottledLogger struct { stop bool flusherDone chan bool Timestamper + Immediate *log.Logger } // RFC3339Fixed is a fixed-width version of RFC3339 with microsecond precision, @@ -59,6 +60,9 @@ func (tl *ThrottledLogger) Write(p []byte) (n int, err error) { sc := bufio.NewScanner(bytes.NewBuffer(p)) for sc.Scan() { _, err = fmt.Fprintf(tl.buf, "%s %s\n", now, sc.Text()) + if tl.Immediate != nil { + tl.Immediate.Printf("%s %s\n", now, sc.Text()) + } } return len(p), err }