From 4b7d3e57a40214a1269eda59731aa22a8f4463dd Mon Sep 17 00:00:00 2001 From: Bjørn Erik Pedersen Date: Thu, 1 Nov 2018 22:27:42 +0100 Subject: Make WARN the new default log log level This commit also pulls down the log level for a set of WARN statements to INFO. There should be no ERRORs or WARNINGs in a regular Hugo build. That is the story about the Boy Who Cried Wolf. Since the WARN log is now more visible, this commit also improves on some of them, most notable the "layout not found", which now would look something like this: ```bash WARN 2018/11/02 09:02:18 Found no layout for "home", language "en", output format "CSS": create a template below /layouts with one of these filenames: index.en.css.css, home.en.css.css, list.en.css.css, index.css.css, home.css.css, list.css.css, index.en.css, home.en.css, list.en.css, index.css, home.css, list.css, _default/index.en.css.css, _default/home.en.css.css, _default/list.en.css.css, _default/index.css.css, _default/home.css.css, _default/list.css.css, _default/index.en.css, _default/home.en.css, _default/list.en.css, _default/index.css, _default/home.css, _default/list.css ``` Fixes #5203 --- tpl/data/data.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tpl/data') diff --git a/tpl/data/data.go b/tpl/data/data.go index 8b3eb8292..cecce4b45 100644 --- a/tpl/data/data.go +++ b/tpl/data/data.go @@ -50,7 +50,7 @@ func (ns *Namespace) GetCSV(sep string, urlParts ...string) (d [][]string, err e url := strings.Join(urlParts, "") var clearCacheSleep = func(i int, u string) { - ns.deps.Log.WARN.Printf("Retry #%d for %s and sleeping for %s", i, url, resSleep) + ns.deps.Log.INFO.Printf("Retry #%d for %s and sleeping for %s", i, url, resSleep) time.Sleep(resSleep) deleteCache(url, ns.deps.Fs.Source, ns.deps.Cfg) } @@ -109,8 +109,8 @@ func (ns *Namespace) GetJSON(urlParts ...string) (v interface{}, err error) { } err = json.Unmarshal(c, &v) if err != nil { - ns.deps.Log.WARN.Printf("Cannot read JSON from resource %s: %s", url, err) - ns.deps.Log.WARN.Printf("Retry #%d for %s and sleeping for %s", i, url, resSleep) + ns.deps.Log.INFO.Printf("Cannot read JSON from resource %s: %s", url, err) + ns.deps.Log.INFO.Printf("Retry #%d for %s and sleeping for %s", i, url, resSleep) time.Sleep(resSleep) deleteCache(url, ns.deps.Fs.Source, ns.deps.Cfg) continue -- cgit v1.2.3