aboutsummaryrefslogtreecommitdiff
path: root/hotline/panic.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2024-06-10 16:49:37 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2024-06-10 16:53:31 -0700
commita6216dd89252fa01dc176f98f1e4ecfd3f637566 (patch)
tree125aa765058693626207e04da5d01c37827ed036 /hotline/panic.go
parent5cc444c89968dda9060d4e2f458b1babb9b603cd (diff)
Replace zap logger with slog
Diffstat (limited to 'hotline/panic.go')
-rw-r--r--hotline/panic.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/hotline/panic.go b/hotline/panic.go
index e7c97db..d7376db 100644
--- a/hotline/panic.go
+++ b/hotline/panic.go
@@ -2,14 +2,14 @@ package hotline
import (
"fmt"
- "go.uber.org/zap"
+ "log/slog"
"runtime/debug"
)
// dontPanic logs panics instead of crashing
-func dontPanic(logger *zap.SugaredLogger) {
+func dontPanic(logger *slog.Logger) {
if r := recover(); r != nil {
fmt.Println("stacktrace from panic: \n" + string(debug.Stack()))
- logger.Errorw("PANIC", "err", r, "trace", string(debug.Stack()))
+ logger.Error("PANIC", "err", r, "trace", string(debug.Stack()))
}
}