From 5e9953ec27979675160f45a5824ac727f5c5cd50 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Mon, 30 May 2016 09:26:59 +0200 Subject: [PATCH] toggledlog: wpanic: use Logger.Panic instead of naked panic This makes sure the panic message also ends up in syslog (if enabled). --- internal/toggledlog/log.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/toggledlog/log.go b/internal/toggledlog/log.go index 31a9eb6..7f437c8 100644 --- a/internal/toggledlog/log.go +++ b/internal/toggledlog/log.go @@ -36,7 +36,7 @@ func (l *toggledLogger) Printf(format string, v ...interface{}) { } l.Logger.Printf(format, v...) if l.Wpanic { - panic(wpanicMsg + fmt.Sprintf(format, v...)) + l.Logger.Panic(wpanicMsg + fmt.Sprintf(format, v...)) } } func (l *toggledLogger) Println(v ...interface{}) { @@ -45,7 +45,7 @@ func (l *toggledLogger) Println(v ...interface{}) { } l.Logger.Println(v...) if l.Wpanic { - panic(wpanicMsg + fmt.Sprintln(v...)) + l.Logger.Panic(wpanicMsg + fmt.Sprintln(v...)) } }