Add some tests for IgnoreFiles

And log error on invalid regexp.

See #1189
This commit is contained in:
bep 2015-06-03 18:54:30 +02:00
parent beaa1b3aad
commit beeae6ab69
3 changed files with 33 additions and 18 deletions

View file

@ -198,12 +198,12 @@ func NewDistinctErrorLogger() *DistinctErrorLogger {
}
// Avoid spamming the logs with errors
var deprecatedLogger = NewDistinctErrorLogger()
var 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)
deprecatedLogger.Printf("%s's %s is deprecated and will be removed VERY SOON. Use %s instead.", object, item, alternative)
DistinctErrorLog.Printf("%s's %s is deprecated and will be removed VERY SOON. Use %s instead.", object, item, alternative)
}