mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
@@ -17,7 +17,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"mime"
|
||||
"net/url"
|
||||
"path"
|
||||
@@ -27,6 +26,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/bep/logg"
|
||||
"github.com/gohugoio/hugo/common/herrors"
|
||||
"github.com/gohugoio/hugo/common/htime"
|
||||
"github.com/gohugoio/hugo/common/hugio"
|
||||
@@ -285,7 +285,7 @@ func (s *Site) isEnabled(kind string) bool {
|
||||
type siteRefLinker struct {
|
||||
s *Site
|
||||
|
||||
errorLogger *log.Logger
|
||||
errorLogger logg.LevelLogger
|
||||
notFoundURL string
|
||||
}
|
||||
|
||||
@@ -302,11 +302,11 @@ func newSiteRefLinker(s *Site) (siteRefLinker, error) {
|
||||
|
||||
func (s siteRefLinker) logNotFound(ref, what string, p page.Page, position text.Position) {
|
||||
if position.IsValid() {
|
||||
s.errorLogger.Printf("[%s] REF_NOT_FOUND: Ref %q: %s: %s", s.s.Lang(), ref, position.String(), what)
|
||||
s.errorLogger.Logf("[%s] REF_NOT_FOUND: Ref %q: %s: %s", s.s.Lang(), ref, position.String(), what)
|
||||
} else if p == nil {
|
||||
s.errorLogger.Printf("[%s] REF_NOT_FOUND: Ref %q: %s", s.s.Lang(), ref, what)
|
||||
s.errorLogger.Logf("[%s] REF_NOT_FOUND: Ref %q: %s", s.s.Lang(), ref, what)
|
||||
} else {
|
||||
s.errorLogger.Printf("[%s] REF_NOT_FOUND: Ref %q from page %q: %s", s.s.Lang(), ref, p.Pathc(), what)
|
||||
s.errorLogger.Logf("[%s] REF_NOT_FOUND: Ref %q from page %q: %s", s.s.Lang(), ref, p.Pathc(), what)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -507,9 +507,6 @@ func (s *Site) processPartial(config *BuildCfg, init func(config *BuildCfg) erro
|
||||
i18nChanged bool
|
||||
|
||||
sourceFilesChanged = make(map[string]bool)
|
||||
|
||||
// prevent spamming the log on changes
|
||||
logger = helpers.NewDistinctErrorLogger()
|
||||
)
|
||||
|
||||
var cacheBusters []func(string) bool
|
||||
@@ -531,7 +528,7 @@ func (s *Site) processPartial(config *BuildCfg, init func(config *BuildCfg) erro
|
||||
|
||||
switch id.Type {
|
||||
case files.ComponentFolderContent:
|
||||
logger.Println("Source changed", ev)
|
||||
s.Log.Println("Source changed", ev)
|
||||
sourceChanged = append(sourceChanged, ev)
|
||||
case files.ComponentFolderLayouts:
|
||||
tmplChanged = true
|
||||
@@ -539,16 +536,16 @@ func (s *Site) processPartial(config *BuildCfg, init func(config *BuildCfg) erro
|
||||
tmplAdded = true
|
||||
}
|
||||
if tmplAdded {
|
||||
logger.Println("Template added", ev)
|
||||
s.Log.Println("Template added", ev)
|
||||
} else {
|
||||
logger.Println("Template changed", ev)
|
||||
s.Log.Println("Template changed", ev)
|
||||
}
|
||||
|
||||
case files.ComponentFolderData:
|
||||
logger.Println("Data changed", ev)
|
||||
s.Log.Println("Data changed", ev)
|
||||
dataChanged = true
|
||||
case files.ComponentFolderI18n:
|
||||
logger.Println("i18n changed", ev)
|
||||
s.Log.Println("i18n changed", ev)
|
||||
i18nChanged = true
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user