diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-03-29 08:08:45 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-03-29 08:08:45 +0200 |
commit | 87b3cd4655088c5e4bb519ea310386959850000d (patch) | |
tree | ec056860e054c3e7b66073990c3e1b15c57f0bd7 /helpers | |
parent | 5989c4d46474298e7f9f26ddeec8e3ec62ae5677 (diff) |
hugolib, helpers: Reduce log level to WARN on .Render for non-regular pages
We will eventually support all types in the Render method.
Diffstat (limited to 'helpers')
-rw-r--r-- | helpers/general.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/helpers/general.go b/helpers/general.go index f9e67e72d..327aafdc6 100644 --- a/helpers/general.go +++ b/helpers/general.go @@ -250,6 +250,11 @@ func NewDistinctErrorLogger() *DistinctLogger { return &DistinctLogger{m: make(map[string]bool), logger: jww.ERROR} } +// NewDistinctWarnLogger creates a new DistinctLogger that logs WARNs +func NewDistinctWarnLogger() *DistinctLogger { + return &DistinctLogger{m: make(map[string]bool), logger: jww.WARN} +} + // NewDistinctFeedbackLogger creates a new DistinctLogger that can be used // to give feedback to the user while not spamming with duplicates. func NewDistinctFeedbackLogger() *DistinctLogger { @@ -260,13 +265,16 @@ var ( // DistinctErrorLog can be used to avoid spamming the logs with errors. DistinctErrorLog = NewDistinctErrorLogger() + // DistinctWarnLog can be used to avoid spamming the logs with warnings. + DistinctWarnLog = NewDistinctWarnLogger() + // DistinctFeedbackLog can be used to avoid spamming the logs with info messages. DistinctFeedbackLog = NewDistinctFeedbackLogger() ) // InitLoggers sets up the global distinct loggers. func InitLoggers() { - DistinctErrorLog = NewDistinctErrorLogger() + jww.ResetLogCounters() } // Deprecated informs about a deprecation, but only once for a given set of arguments' values. |