projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
6518: strigger works
[arvados.git]
/
services
/
crunch-run
/
logging.go
diff --git
a/services/crunch-run/logging.go
b/services/crunch-run/logging.go
index 09b328a3cbdcfaeaed8fe44a579ca5b995ff2fa3..20928dbef769b0d4dd419ec0f8693541c93ba369 100644
(file)
--- 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
stop bool
flusherDone chan bool
Timestamper
+ Immediate *log.Logger
}
// RFC3339Fixed is a fixed-width version of RFC3339 with microsecond precision,
}
// 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())
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
}
}
return len(p), err
}