diff options
-rw-r--r-- | commands/hugo.go | 6 | ||||
-rw-r--r-- | helpers/general.go | 4 |
2 files changed, 9 insertions, 1 deletions
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. |