Commit 4cc708ae authored by Shenghou Ma's avatar Shenghou Ma

log/syslog: document if network=="" for Dial, it will connect to local syslog server.

Fixes #7828.

LGTM=robert.hencke, iant, bradfitz
R=golang-codereviews, robert.hencke, iant, bradfitz
CC=golang-codereviews
https://golang.org/cl/97780045
parent 6be21b9f
...@@ -115,9 +115,10 @@ func New(priority Priority, tag string) (w *Writer, err error) { ...@@ -115,9 +115,10 @@ func New(priority Priority, tag string) (w *Writer, err error) {
} }
// 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 network net. 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 given facility, severity and
// tag. // tag.
// If network is empty, Dial will connect to the local syslog server.
func Dial(network, raddr string, priority Priority, tag string) (*Writer, error) { func Dial(network, raddr string, priority Priority, tag string) (*Writer, error) {
if priority < 0 || priority > LOG_LOCAL7|LOG_DEBUG { if priority < 0 || priority > LOG_LOCAL7|LOG_DEBUG {
return nil, errors.New("log/syslog: invalid priority") return nil, errors.New("log/syslog: invalid priority")
......
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