summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-05-30 09:26:59 +0200
committerJakob Unterwurzacher2016-05-30 09:26:59 +0200
commit5e9953ec27979675160f45a5824ac727f5c5cd50 (patch)
treefafa25e10d2a0d2407121669b03c86225f17212c /internal
parent1648c54adb9b7d9d8984857a35c6092bbae6bdec (diff)
toggledlog: wpanic: use Logger.Panic instead of naked panic
This makes sure the panic message also ends up in syslog (if enabled).
Diffstat (limited to 'internal')
-rw-r--r--internal/toggledlog/log.go4
1 files 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...))
}
}