Skip to content

Commit

Permalink
feat: add some logging for dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Brereton authored and Tom Brereton committed Jan 10, 2024
1 parent ed70ebc commit 93cbdb8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/web/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package server

import (
"html/template"
"log"
"net/http"

"github.com/aarol/reload"
Expand All @@ -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()
Expand Down

0 comments on commit 93cbdb8

Please sign in to comment.