From 6c3f97399a01a2d8480b39978209099335efbf7d Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 15 Jun 2016 23:30:44 +0200 Subject: Rename internal "toggledlog" package to "tlog" 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' {} + --- internal/tlog/log_go1.5.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 internal/tlog/log_go1.5.go (limited to 'internal/tlog/log_go1.5.go') diff --git a/internal/tlog/log_go1.5.go b/internal/tlog/log_go1.5.go new file mode 100644 index 0000000..755f623 --- /dev/null +++ b/internal/tlog/log_go1.5.go @@ -0,0 +1,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) + } +} -- cgit v1.2.3