From b96e3ee2717531e842c492c3a6799d1d0c3e51cb Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 28 Feb 2018 09:02:18 +0100 Subject: tlog: stop embedding log.Logger to prevent mistakes A few places have called tlog.Warn.Print, which directly calls into log.Logger due to embedding, losing all features of tlog. Stop embedding log.Logger to make sure the internal functions cannot be called accidentially and fix (several!) instances that did. --- internal/tlog/log.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/tlog') diff --git a/internal/tlog/log.go b/internal/tlog/log.go index 720bb88..f6c0acf 100644 --- a/internal/tlog/log.go +++ b/internal/tlog/log.go @@ -53,7 +53,7 @@ type toggledLogger struct { prefix string postfix string - *log.Logger + Logger *log.Logger } func (l *toggledLogger) Printf(format string, v ...interface{}) { @@ -125,7 +125,7 @@ func (l *toggledLogger) SwitchToSyslog(p syslog.Priority) { if err != nil { Warn.Printf("SwitchToSyslog: %v", err) } else { - l.SetOutput(w) + l.Logger.SetOutput(w) } } -- cgit v1.2.3