Skip to content

Commit

Permalink
Lib: Remove trailing newline from Go checkerlib log messages via IPC
Browse files Browse the repository at this point in the history
We are not logging to stderr but to the Control Master which does not
require a trailing newline.
  • Loading branch information
rudis authored and F30 committed Jun 17, 2020
1 parent 707df5b commit 667eb92
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion go/checkerlib/logger.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package checkerlib

import (
"bytes"
)

type logger struct{}

// "log" calls Write() once per log call
Expand All @@ -11,7 +15,7 @@ func (l logger) Write(p []byte) (int, error) {
//`json:"lineno"`
//`json:"funcName"`
}{
string(p),
string(bytes.TrimSuffix(p, []byte{'\n'})),
}
ipc.Send("LOG", x)
return len(p), nil
Expand Down

0 comments on commit 667eb92

Please sign in to comment.