From 7bfeb5f94078d7263175db40ca2b6ef5e636bf72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Mon, 22 Jan 2024 21:52:42 -0800 Subject: [PATCH] debug log when template is rendered --- internal/render/render.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/render/render.go b/internal/render/render.go index 0096d96..d50b5b0 100644 --- a/internal/render/render.go +++ b/internal/render/render.go @@ -48,6 +48,7 @@ func GenerateNewTemplateCache() (models.TemplateCache, error) { for _, page := range pages { name := filepath.Base(page) app.Logger.Info("Generating template " + name) + generatedAt := time.Now() templateSet, err := template.New(name).ParseFiles(page) if err != nil { @@ -68,8 +69,9 @@ func GenerateNewTemplateCache() (models.TemplateCache, error) { } cache.Cache[name] = models.TemplateCacheItem{ Template: templateSet, - GeneratedAt: time.Now(), + GeneratedAt: generatedAt, } + app.Logger.Debugf("Generated %s at %v", name, generatedAt.String()) } // All was good, so return the cache, and no error