toggledlog: wpanic: use Logger.Panic instead of naked panic

This makes sure the panic message also ends up in syslog
(if enabled).
This commit is contained in:
Jakob Unterwurzacher 2016-05-30 09:26:59 +02:00
parent 1648c54adb
commit 5e9953ec27

View File

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