mirror of
https://github.com/golang/go
synced 2024-11-13 18:10:24 -07:00
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
This commit is contained in:
parent
6289dccf8b
commit
4c2df76b7d
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user