hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 04d80e6e8725dd9d1ee76d7615ae312f995cd7bc
parent 0802f79e666c7221e8b5580c9ccfbfb538a20b95
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Tue,  4 Apr 2017 11:02:12 +0200

commands, helpers: Add correct verbose log level to the global loggers

We still use those in some cases.

Diffstat:
Mcommands/hugo.go | 6++++++
Mhelpers/general.go | 4+++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git 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
@@ -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.