diff options
author | Brad Fitzpatrick <bradfitz@golang.org> | 2017-06-08 17:44:03 +0000 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2017-06-08 20:15:55 +0000 |
commit | 1570a27e78a46521c4ab46498e29a1ad7c606f7d (patch) | |
tree | 15d90ed22596177b508878dbbdc586cff0579ec0 /src/log | |
parent | 84890c72fc2668074549b4e47b9f21e6fb955cff (diff) | |
download | go-1570a27e78a46521c4ab46498e29a1ad7c606f7d.tar.gz go-1570a27e78a46521c4ab46498e29a1ad7c606f7d.zip |
log/syslog: expand docs a bit to reduce confusion
Fixes #15731
Change-Id: I6f4da0cbb3b6c93e175f5e384ffa118f383b7c3b
Reviewed-on: https://go-review.googlesource.com/45089
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/log')
-rw-r--r-- | src/log/syslog/syslog.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/log/syslog/syslog.go b/src/log/syslog/syslog.go index df9ffb8e33..dfd0028e5c 100644 --- a/src/log/syslog/syslog.go +++ b/src/log/syslog/syslog.go @@ -102,15 +102,16 @@ type netConn struct { // New establishes a new connection to the system log daemon. Each // write to the returned writer sends a log message with the given -// priority and prefix. +// priority (a combination of the syslog facility and severity) and +// prefix tag. If tag is empty, the os.Args[0] is used. func New(priority Priority, tag string) (*Writer, error) { return Dial("", "", priority, tag) } // Dial establishes a connection to a log daemon by connecting to // address raddr on the specified network. Each write to the returned -// writer sends a log message with the given facility, severity and -// tag. +// writer sends a log message with the facility and severity +// (from priority) and tag. If tag is empty, the os.Args[0] is used. // If network is empty, Dial will connect to the local syslog server. // Otherwise, see the documentation for net.Dial for valid values // of network and raddr. @@ -301,10 +302,10 @@ func (n *netConn) close() error { return n.conn.Close() } -// NewLogger creates a log.Logger whose output is written to -// the system log service with the specified priority. The logFlag -// argument is the flag set passed through to log.New to create -// the Logger. +// NewLogger creates a log.Logger whose output is written to the +// system log service with the specified priority, a combination of +// the syslog facility and severity. The logFlag argument is the flag +// set passed through to log.New to create the Logger. func NewLogger(p Priority, logFlag int) (*log.Logger, error) { s, err := New(p, "") if err != nil { |