Skip to content
This repository has been archived by the owner on Mar 18, 2019. It is now read-only.

Commit

Permalink
localConn acts more like netConn
Browse files Browse the repository at this point in the history
  • Loading branch information
sirsean committed Jan 20, 2016
1 parent 5268e16 commit 035b3af
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions srslog_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ type localConn struct {

// writeString formats syslog messages using time.Stamp instead of time.RFC3339,
// and omits the hostname (because it is expected to be used locally).
func (n *localConn) writeString(framer Framer, f Formatter, p Priority, hostname, tag, msg string) error {
_, err := n.conn.Write([]byte(DefaultFramer(UnixFormatter(p, hostname, tag, msg))))
func (n *localConn) writeString(framer Framer, formatter Formatter, p Priority, hostname, tag, msg string) error {
if framer == nil {
framer = DefaultFramer
}
if formatter == nil {
formatter = UnixFormatter
}
_, err := n.conn.Write([]byte(framer(formatter(p, hostname, tag, msg))))
return err
}

Expand Down

0 comments on commit 035b3af

Please sign in to comment.