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:
parent
1648c54adb
commit
5e9953ec27
|
@ -36,7 +36,7 @@ func (l *toggledLogger) Printf(format string, v ...interface{}) {
|
||||||
}
|
}
|
||||||
l.Logger.Printf(format, v...)
|
l.Logger.Printf(format, v...)
|
||||||
if l.Wpanic {
|
if l.Wpanic {
|
||||||
panic(wpanicMsg + fmt.Sprintf(format, v...))
|
l.Logger.Panic(wpanicMsg + fmt.Sprintf(format, v...))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (l *toggledLogger) Println(v ...interface{}) {
|
func (l *toggledLogger) Println(v ...interface{}) {
|
||||||
|
@ -45,7 +45,7 @@ func (l *toggledLogger) Println(v ...interface{}) {
|
||||||
}
|
}
|
||||||
l.Logger.Println(v...)
|
l.Logger.Println(v...)
|
||||||
if l.Wpanic {
|
if l.Wpanic {
|
||||||
panic(wpanicMsg + fmt.Sprintln(v...))
|
l.Logger.Panic(wpanicMsg + fmt.Sprintln(v...))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue