summaryrefslogtreecommitdiff
path: root/sd_daemon/log.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-12-18 15:43:59 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2017-12-18 22:40:06 -0500
commitb0c40f4c505fcf29d3ef8080c5e0d75d49000712 (patch)
tree55e240fa04b8a4160deead1463c7f048ef23bf9a /sd_daemon/log.go
parenteb9b6bb15666ab0044e2244d75288f0d010431ec (diff)
sd_daemon: BREAKING CHANGE: rename WriteBytes->LogBytes, WriteString->LogStringv0.5.0
This is to make room for an io.stringWriter implementation.
Diffstat (limited to 'sd_daemon/log.go')
-rw-r--r--sd_daemon/log.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/sd_daemon/log.go b/sd_daemon/log.go
index dc77907..1bdf65f 100644
--- a/sd_daemon/log.go
+++ b/sd_daemon/log.go
@@ -74,9 +74,9 @@ func appendPrefix(buf []byte, n syslog.Priority) []byte {
return append(buf, b[i:]...)
}
-// WriteString writes a message with the specified priority to the
+// LogString writes a message with the specified priority to the
// log.
-func (l *Logger) WriteString(pri syslog.Priority, msg string) (n int, err error) {
+func (l *Logger) LogString(pri syslog.Priority, msg string) (n int, err error) {
l.mu.Lock()
defer l.mu.Unlock()
@@ -111,10 +111,10 @@ func (l *Logger) WriteString(pri syslog.Priority, msg string) (n int, err error)
return l.out.Write(l.buf)
}
-// WriteBytes writes a message with the specified priority to the
+// LogBytes writes a message with the specified priority to the
// log.
-func (l *Logger) WriteBytes(pri syslog.Priority, msg []byte) (n int, err error) {
- // Copy/pasted from WriteString and
+func (l *Logger) LogBytes(pri syslog.Priority, msg []byte) (n int, err error) {
+ // Copy/pasted from LogString and
// * `strings.` -> `bytes.`
// * `"\n"` -> `[]byte{'\n'}`
l.mu.Lock()
@@ -151,7 +151,7 @@ type loggerWriter struct {
}
func (lw loggerWriter) Write(p []byte) (n int, err error) {
- return lw.log.WriteBytes(lw.pri, p)
+ return lw.log.LogBytes(lw.pri, p)
}
// Writer returns an io.Writer that writes messages with the specified