diff options
author | Cameron Moore <moorereason@gmail.com> | 2017-09-27 14:17:43 -0500 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-09-27 21:26:08 +0200 |
commit | b277cb33e4dfa7440fca3b7888026944ce056154 (patch) | |
tree | dc1cd19b6b849a9b34f866d92d56f29eae09772f /hugolib/hugo_sites_build.go | |
parent | a354d130dc8aaab8bdaf7223af3aa862db44c9d5 (diff) |
hugolib: Move metrics output to the end of the site build
Diffstat (limited to 'hugolib/hugo_sites_build.go')
-rw-r--r-- | hugolib/hugo_sites_build.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/hugolib/hugo_sites_build.go b/hugolib/hugo_sites_build.go index f73989908..b3e0e8bdc 100644 --- a/hugolib/hugo_sites_build.go +++ b/hugolib/hugo_sites_build.go @@ -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 } |