mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-27 22:09:53 +02:00
hugolib: Move metrics output to the end of the site build
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
a354d130dc
commit
b277cb33e4
@@ -14,6 +14,7 @@
|
||||
package hugolib
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"time"
|
||||
|
||||
"errors"
|
||||
@@ -66,6 +67,15 @@ func (h *HugoSites) Build(config BuildCfg, events ...fsnotify.Event) error {
|
||||
h.Log.FEEDBACK.Printf("total in %v ms\n", int(1000*time.Since(t0).Seconds()))
|
||||
}
|
||||
|
||||
if h.Metrics != nil {
|
||||
var b bytes.Buffer
|
||||
h.Metrics.WriteMetrics(&b)
|
||||
|
||||
h.Log.FEEDBACK.Printf("\nTemplate Metrics:\n\n")
|
||||
h.Log.FEEDBACK.Print(b.String())
|
||||
h.Log.FEEDBACK.Println()
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user