commands, helpers: Add correct verbose log level to the global loggers
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 4 Apr 2017 09:02:12 +0000 (11:02 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 4 Apr 2017 13:12:30 +0000 (15:12 +0200)
We still use those in some cases.

commands/hugo.go
helpers/general.go

index 5a056996d2e5cc0d348ddb1116b73fd6cc47a9b2..3d922deff96cea20c42af44ad0383fb884066646 100644 (file)
@@ -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
 }
 
index 327aafdc6bfa9bc3ca9d5953bce1cbb97470decc..ac2af4936dd28b2dbf283dfa61f97f6e15361940 100644 (file)
@@ -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.