Commit 1570a27e authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

log/syslog: expand docs a bit to reduce confusion

Fixes #15731

Change-Id: I6f4da0cbb3b6c93e175f5e384ffa118f383b7c3b
Reviewed-on: https://go-review.googlesource.com/45089Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 84890c72
...@@ -102,15 +102,16 @@ type netConn struct { ...@@ -102,15 +102,16 @@ type netConn struct {
// New establishes a new connection to the system log daemon. Each // New establishes a new connection to the system log daemon. Each
// write to the returned writer sends a log message with the given // 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) { func New(priority Priority, tag string) (*Writer, error) {
return Dial("", "", priority, tag) return Dial("", "", priority, tag)
} }
// Dial establishes a connection to a log daemon by connecting to // Dial establishes a connection to a log daemon by connecting to
// address raddr on the specified network. Each write to the returned // address raddr on the specified network. Each write to the returned
// writer sends a log message with the given facility, severity and // writer sends a log message with the facility and severity
// tag. // (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. // If network is empty, Dial will connect to the local syslog server.
// Otherwise, see the documentation for net.Dial for valid values // Otherwise, see the documentation for net.Dial for valid values
// of network and raddr. // of network and raddr.
...@@ -301,10 +302,10 @@ func (n *netConn) close() error { ...@@ -301,10 +302,10 @@ func (n *netConn) close() error {
return n.conn.Close() return n.conn.Close()
} }
// NewLogger creates a log.Logger whose output is written to // NewLogger creates a log.Logger whose output is written to the
// the system log service with the specified priority. The logFlag // system log service with the specified priority, a combination of
// argument is the flag set passed through to log.New to create // the syslog facility and severity. The logFlag argument is the flag
// the Logger. // set passed through to log.New to create the Logger.
func NewLogger(p Priority, logFlag int) (*log.Logger, error) { func NewLogger(p Priority, logFlag int) (*log.Logger, error) {
s, err := New(p, "") s, err := New(p, "")
if err != nil { if err != nil {
......
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