Reset the i18n func map on reload

Also improve the error message on missing resource bundles.
This commit is contained in:
Bjørn Erik Pedersen
2016-09-08 17:04:04 +03:00
parent 5ef45bec63
commit fe0c270577
3 changed files with 18 additions and 9 deletions

View File

@@ -229,6 +229,11 @@ func NewDistinctFeedbackLogger() *DistinctLogger {
// DistinctErrorLog cann be used to avoid spamming the logs with errors.
var DistinctErrorLog = NewDistinctErrorLogger()
// InitLoggers sets up the global distinct loggers.
func InitLoggers() {
DistinctErrorLog = NewDistinctErrorLogger()
}
// Deprecated logs ERROR logs about a deprecation, but only once for a given set of arguments' values.
func Deprecated(object, item, alternative string) {
// deprecatedLogger.Printf("%s's %s is deprecated and will be removed in Hugo %s. Use %s instead.", object, item, NextHugoReleaseVersion(), alternative)