https://codereview.appspot.com/6782118/diff/3004/src/pkg/log/syslog/syslog.goFile src/pkg/log/syslog/syslog.go (right):
https://codereview.appspot.com/6782118/diff/3004/src/pkg/log/syslog/syslog.go#newcode22src/pkg/log/syslog/syslog.go:22: // severity. To set the facility and
severity merge bitwise OR a
On 2012/11/26 17:07:59, rsc wrote:
the "To set..." can be shortened to "For example, LOG_ALERT | LOG_FTP
..."
Done.
https://codereview.appspot.com/6782118/diff/3004/src/pkg/log/syslog/syslog.go#newcode24src/pkg/log/syslog/syslog.go:24: // priority message from the FTP
facility. If no severity is included
On 2012/11/26 17:07:59, rsc wrote:
s/If no.../The default severity is LOG_EMERG; the default facility is
LOG_KERN.
Done.
https://codereview.appspot.com/6782118/diff/3004/src/pkg/log/syslog/syslog.go#newcode33src/pkg/log/syslog/syslog.go:33:
On 2012/11/26 17:07:59, rsc wrote:
Delete blank line.
Done.
https://codereview.appspot.com/6782118/diff/3004/src/pkg/log/syslog/syslog.go#newcode34src/pkg/log/syslog/syslog.go:34: // The syslog severity
On 2012/11/26 17:07:59, rsc wrote:
We're in package syslog so this can shorten to
// Severity.
Done.
https://codereview.appspot.com/6782118/diff/3004/src/pkg/log/syslog/syslog.go#newcode49src/pkg/log/syslog/syslog.go:49:
On 2012/11/26 17:07:59, rsc wrote:
Delete blank line.
Done.
https://codereview.appspot.com/6782118/diff/3004/src/pkg/log/syslog/syslog.go#newcode50src/pkg/log/syslog/syslog.go:50: // The syslog facility
On 2012/11/26 17:07:59, rsc wrote:
// Facility.
Done.
https://codereview.appspot.com/6782118/diff/3004/src/pkg/log/syslog/syslog.go#newcode54src/pkg/log/syslog/syslog.go:54: LOG_KERN Priority = iota << 3
On 2012/11/26 17:07:59, rsc wrote:
I'd like to avoid changing these constants in the future. Let's use 8 or 16 and
then there is plenty of room to grow on both sides.
Doing that would mean that the package would have to internally
translate from these values to the actual values used in syslog itself.
Given that these values are drawn from /usr/include/sys/syslog.h I think
it's better and clearer to leave them as is.
https://codereview.appspot.com/6782118/diff/3004/src/pkg/log/syslog/syslog.go#newcode67src/pkg/log/syslog/syslog.go:67: LOG_LOCAL0 Priority = (iota + 16) << 3
That's a mistake I introduced following a change suggested by bradfitz.
I have corrected it and added a test case.
https://codereview.appspot.com/6782118/diff/3004/src/pkg/log/syslog/syslog.go#newcode95src/pkg/log/syslog/syslog.go:95: // specifies the facility and default
severity. The default severity
On 2012/11/26 17:07:59, rsc wrote:
Let's avoid explaining facility and severity multiple times. The docs on
Priority make it clear. Also, I think we can leave the special case
descriptions
of Emerg, Alert, Crit, etc to those method comments, so I think we can just
leave this comment as it was (the rewrite lost the information about
each write
generating a message):
// 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.
Done.
https://codereview.appspot.com/6782118/diff/3004/src/pkg/log/syslog/syslog.go#newcode115src/pkg/log/syslog/syslog.go:115: hostname, err := os.Hostname()
On 2012/11/26 17:07:59, rsc wrote:
You don't appear to use err here. Make that clear.
hostname, _ := os.Hostname()
var err error below
Done.
https://codereview.appspot.com/6782118/diff/3004/src/pkg/log/syslog/syslog.go#newcode145src/pkg/log/syslog/syslog.go:145: // Emerg logs a message using the
LOG_EMERG severity and facility set
On 2012/11/26 17:07:59, rsc wrote:
// Emerg logs a message with severity LOG_EMERG, ignoring the severity passed to
New.
etc
Done.
https://codereview.appspot.com/6782118/diff/3004/src/pkg/log/syslog/syslog.go#newcode226src/pkg/log/syslog/syslog.go:226: // system log service with the
specified facility and severity. The
On 2012/11/26 17:07:59, rsc wrote:
This comment can be reverted too.
Done.
https://codereview.appspot.com/6782118/