debug log when template is rendered
This commit is contained in:
parent
a7f6bb35e7
commit
7bfeb5f940
|
@ -48,6 +48,7 @@ func GenerateNewTemplateCache() (models.TemplateCache, error) {
|
||||||
for _, page := range pages {
|
for _, page := range pages {
|
||||||
name := filepath.Base(page)
|
name := filepath.Base(page)
|
||||||
app.Logger.Info("Generating template " + name)
|
app.Logger.Info("Generating template " + name)
|
||||||
|
generatedAt := time.Now()
|
||||||
|
|
||||||
templateSet, err := template.New(name).ParseFiles(page)
|
templateSet, err := template.New(name).ParseFiles(page)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -68,8 +69,9 @@ func GenerateNewTemplateCache() (models.TemplateCache, error) {
|
||||||
}
|
}
|
||||||
cache.Cache[name] = models.TemplateCacheItem{
|
cache.Cache[name] = models.TemplateCacheItem{
|
||||||
Template: templateSet,
|
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
|
// All was good, so return the cache, and no error
|
||||||
|
|
Loading…
Reference in a new issue