From 93cbdb85b6ee7f0df06da6337ec4a3c628ef0c4d Mon Sep 17 00:00:00 2001 From: Tom Brereton Date: Wed, 10 Jan 2024 14:32:22 +1100 Subject: [PATCH] feat: add some logging for dev mode --- cmd/web/main.go | 1 + internal/server/server.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/cmd/web/main.go b/cmd/web/main.go index eabc542..7b68f54 100644 --- a/cmd/web/main.go +++ b/cmd/web/main.go @@ -19,6 +19,7 @@ func main() { if err != nil { log.Fatal(err.Error()) } + log.Default().Printf("Is Development mode enabled: %t", cfg.IsDevelopment) server := server.NewWebServer(&cfg) address := "localhost:" + cfg.Port diff --git a/internal/server/server.go b/internal/server/server.go index 43257c2..fb422a6 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -2,6 +2,7 @@ package server import ( "html/template" + "log" "net/http" "github.com/aarol/reload" @@ -24,6 +25,7 @@ func NewWebServer(cfg *Config) *Server { s.AddHtmlTemplatesToServer() if s.Config.IsDevelopment { + log.Default().Println("Hot reloading enabled") s.MountHotReload() } s.MountMiddleware()