Fix errorProtoLog error messages

Use Printf instead of Println for formatted strings, and pass
the filename instead of the proto.

Test: cuj_tests
Change-Id: Id261b5a34304a0caa61faa1f3bbc388aacdd25a6
This commit is contained in:
Colin Cross 2019-11-26 16:20:03 -08:00
parent 28f527c3da
commit ff27ce4cc0

View file

@ -180,12 +180,12 @@ func (e *errorProtoLog) FinishAction(result ActionResult, counts Counts) {
func (e *errorProtoLog) Flush() {
data, err := proto.Marshal(&e.errorProto)
if err != nil {
e.log.Println("Failed to marshal build status proto: %v", err)
e.log.Printf("Failed to marshal build status proto: %v\n", err)
return
}
err = ioutil.WriteFile(e.filename, []byte(data), 0644)
if err != nil {
e.log.Println("Failed to write file %s: %v", e.errorProto, err)
e.log.Printf("Failed to write file %s: %v\n", e.filename, err)
}
}