aboutsummaryrefslogtreecommitdiff
path: root/internal/tlog/log_go1.5.go
blob: 755f623a1c8fc3296626b3fc2ebc775ecb4a0734 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// +build go1.5
// = go 1.5 or higher

package tlog

import (
	"log/syslog"
)

func (l *toggledLogger) SwitchToSyslog(p syslog.Priority) {
	w, err := syslog.New(p, ProgramName)
	if err != nil {
		Warn.Printf("Cannot switch 0x%02x to syslog: %v", p, err)
	} else {
		l.SetOutput(w)
	}
}