From 7c659757e7cee0bb65a99ade37b1ebb5836b5c99 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Fri, 2 May 2025 09:46:46 +0300 Subject: [PATCH] feat: add structured logging with slog --- handlers/handlers.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/handlers/handlers.go b/handlers/handlers.go index 7fe8a96..da65ba5 100644 --- a/handlers/handlers.go +++ b/handlers/handlers.go @@ -2,9 +2,15 @@ package handlers import ( "html/template" + "log/slog" "net/http" ) +func init() { + // init slog to be at level debug and us json structured logs; ai! + slog = slog.New() +} + var roundWords = map[string]string{ "hamster": "blue", "child": "red",