From c918c8674a7d0374f757364448adf63ab23498f0 Mon Sep 17 00:00:00 2001 From: Nik Afiq Date: Thu, 9 Apr 2026 06:09:44 +0900 Subject: [PATCH] feat: set process-wide default logger for discord-bot --- discord-bot/cmd/bot/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/discord-bot/cmd/bot/main.go b/discord-bot/cmd/bot/main.go index 56a48fd..e399d64 100644 --- a/discord-bot/cmd/bot/main.go +++ b/discord-bot/cmd/bot/main.go @@ -2,6 +2,7 @@ package main import ( "context" + "log/slog" "os" "os/signal" "syscall" @@ -31,6 +32,9 @@ func main() { } log := logger.New(cfg.LogFormat, cfg.LogLevel) + // Set the process-wide default so contexts created at library boundaries + // still inherit the configured JSON/text handler. + slog.SetDefault(log) log.Info("starting discord-bot", "version", version, "ha_gateway_addr", cfg.HAGatewayAddr,