Skip to content
Permalink
Browse files

Reset the "distinct error logger" on rebuilds

Fixes #4818
  • Loading branch information...
bep committed Jun 5, 2018
1 parent 019bd55 commit bf5f10faa9fd445c4dd21839aa7d73cd2acbfb85
Showing with 9 additions and 1 deletion.
  1. +0 −1 commands/hugo.go
  2. +8 −0 hugolib/hugo_sites.go
  3. +1 −0 hugolib/hugo_sites_build.go
@@ -670,7 +670,6 @@ func (c *commandeer) resetAndBuildSites() (err error) {
func (c *commandeer) initSites() error {
if c.hugo != nil {
c.hugo.Cfg = c.Cfg
c.hugo.Log.ResetLogCounters()
return nil
}

@@ -280,6 +280,14 @@ func (h *HugoSites) reset() {
}
}

// resetLogs resets the log counters etc. Used to do a new build on the same sites.
func (h *HugoSites) resetLogs() {
h.Log.ResetLogCounters()
for _, s := range h.Sites {
s.Deps.DistinctErrorLog = helpers.NewDistinctLogger(h.Log.ERROR)
}
}

func (h *HugoSites) createSitesFromConfig() error {
oldLangs, _ := h.Cfg.Get("languagesSorted").(helpers.Languages)

@@ -131,6 +131,7 @@ func (h *HugoSites) initRebuild(config *BuildCfg) error {
s.resetBuildState()
}

h.resetLogs()
helpers.InitLoggers()

return nil

0 comments on commit bf5f10f

Please sign in to comment.
You can’t perform that action at this time.