From 04d80e6e8725dd9d1ee76d7615ae312f995cd7bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 4 Apr 2017 11:02:12 +0200 Subject: [PATCH] commands, helpers: Add correct verbose log level to the global loggers We still use those in some cases. --- commands/hugo.go | 6 ++++++ helpers/general.go | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/commands/hugo.go b/commands/hugo.go index 5a056996d..3d922deff 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -436,6 +436,12 @@ func createLogger(cfg config.Provider) (*jww.Notepad, error) { logThreshold = jww.LevelInfo } + // The global logger is used in some few cases. + jww.SetLogOutput(logHandle) + jww.SetLogThreshold(logThreshold) + jww.SetStdoutThreshold(stdoutThreshold) + helpers.InitLoggers() + return jww.NewNotepad(stdoutThreshold, logThreshold, outHandle, logHandle, "", log.Ldate|log.Ltime), nil } diff --git a/helpers/general.go b/helpers/general.go index 327aafdc6..ac2af4936 100644 --- a/helpers/general.go +++ b/helpers/general.go @@ -274,7 +274,9 @@ var ( // InitLoggers sets up the global distinct loggers. func InitLoggers() { - jww.ResetLogCounters() + DistinctErrorLog = NewDistinctErrorLogger() + DistinctWarnLog = NewDistinctWarnLogger() + DistinctFeedbackLog = NewDistinctFeedbackLogger() } // Deprecated informs about a deprecation, but only once for a given set of arguments' values.