mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
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
This commit is contained in:
@ -45,11 +45,11 @@ func (t Translator) Func(lang string) bundle.TranslateFunc {
|
||||
if f, ok := t.translateFuncs[lang]; ok {
|
||||
return f
|
||||
}
|
||||
t.logger.WARN.Printf("Translation func for language %v not found, use default.", lang)
|
||||
t.logger.INFO.Printf("Translation func for language %v not found, use default.", lang)
|
||||
if f, ok := t.translateFuncs[t.cfg.GetString("defaultContentLanguage")]; ok {
|
||||
return f
|
||||
}
|
||||
t.logger.WARN.Println("i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.")
|
||||
t.logger.INFO.Println("i18n not initialized; if you need string translations, check that you have a bundle in /i18n that matches the site language or the default language.")
|
||||
return func(translationID string, args ...interface{}) string {
|
||||
return ""
|
||||
}
|
||||
@ -61,7 +61,7 @@ func (t Translator) initFuncs(bndl *bundle.Bundle) {
|
||||
|
||||
defaultT, err := bndl.Tfunc(defaultContentLanguage)
|
||||
if err != nil {
|
||||
t.logger.WARN.Printf("No translation bundle found for default language %q", defaultContentLanguage)
|
||||
t.logger.INFO.Printf("No translation bundle found for default language %q", defaultContentLanguage)
|
||||
}
|
||||
|
||||
enableMissingTranslationPlaceholders := t.cfg.GetBool("enableMissingTranslationPlaceholders")
|
||||
|
Reference in New Issue
Block a user