debug log when template is rendered

This commit is contained in:
Lilian Jónsdóttir 2024-01-22 21:52:42 -08:00
parent a7f6bb35e7
commit 7bfeb5f940

View file

@ -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