6c3f97399a
tlog is used heavily everywhere and deserves a shorter name. Renamed using sed magic, without any manual rework: find * -type f -exec sed -i 's/toggledlog/tlog/g' {} +
18 lines
286 B
Go
18 lines
286 B
Go
// +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)
|
|
}
|
|
}
|