1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-02-15 02:55:14 +00:00

refactor: complete conversion of log calls to slog (#787)

This commit is contained in:
Alessandro (Ale) Segala
2025-07-27 06:34:23 +02:00
committed by GitHub
parent 78266e3e4c
commit 42a861d206
22 changed files with 142 additions and 88 deletions

View File

@@ -2,7 +2,7 @@ package signals
import (
"context"
"log"
"log/slog"
"os"
"os/signal"
"syscall"
@@ -28,11 +28,11 @@ func SignalContext(parentCtx context.Context) context.Context {
signal.Notify(sigCh, os.Interrupt, syscall.SIGTERM)
go func() {
<-sigCh
log.Println("Received interrupt signal. Shutting down…")
slog.Info("Received interrupt signal. Shutting down…")
cancel()
<-sigCh
log.Println("Received a second interrupt signal. Forcing an immediate shutdown.")
slog.Warn("Received a second interrupt signal. Forcing an immediate shutdown.")
os.Exit(1)
}()