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) } }