Merge pull request #8972 from tstromberg/record-output

Log output for post-mortem analysis
pull/8976/head
Thomas Strömberg 2020-08-11 13:41:14 -07:00 committed by GitHub
commit 1854dd818c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -101,6 +101,9 @@ func String(format string, a ...interface{}) {
glog.Warningf("[unset outFile]: %s", fmt.Sprintf(format, a...))
return
}
glog.Infof(format, a...)
_, err := fmt.Fprintf(outFile, format, a...)
if err != nil {
glog.Errorf("Fprintf failed: %v", err)
@ -144,6 +147,9 @@ func Err(format string, a ...interface{}) {
glog.Errorf("[unset errFile]: %s", fmt.Sprintf(format, a...))
return
}
glog.Warningf(format, a...)
_, err := fmt.Fprintf(errFile, format, a...)
if err != nil {
glog.Errorf("Fprint failed: %v", err)