Commit 4c2df76b authored by Rob Pike's avatar Rob Pike

log/syslog: report errors from Fprintf

Thanks to chiparus for identifying this.

Fixes #5541.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9658043
parent 6289dccf
...@@ -258,10 +258,9 @@ func (w *Writer) write(p Priority, msg string) (int, error) { ...@@ -258,10 +258,9 @@ func (w *Writer) write(p Priority, msg string) (int, error) {
} }
timestamp := time.Now().Format(time.RFC3339) timestamp := time.Now().Format(time.RFC3339)
fmt.Fprintf(w.conn, "<%d>%s %s %s[%d]: %s%s", return fmt.Fprintf(w.conn, "<%d>%s %s %s[%d]: %s%s",
p, timestamp, w.hostname, p, timestamp, w.hostname,
w.tag, os.Getpid(), msg, nl) w.tag, os.Getpid(), msg, nl)
return len(msg), nil
} }
// NewLogger creates a log.Logger whose output is written to // NewLogger creates a log.Logger whose output is written to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment