improving code coverage

This commit is contained in:
Julien Neuhart
2018-04-05 10:36:38 +02:00
parent 15916e80e6
commit ee15a52001
8 changed files with 95 additions and 14 deletions

View File

@@ -161,8 +161,10 @@ var levels = map[string]logrus.Level{
type wrongLoggingLevelError struct{}
const wrongLoggingLevelErrorMessage = "Accepted values for logging level: DEBUG, INFO, WARN, ERROR, FATAL, PANIC"
func (e *wrongLoggingLevelError) Error() string {
return "Accepted values for logging level: DEBUG, INFO, WARN, ERROR, FATAL, PANIC"
return wrongLoggingLevelErrorMessage
}
// getLoggingLevelFromFileConfig returns a logrus level if a matching was found
@@ -186,8 +188,10 @@ var formatters = map[string]logrus.Formatter{
type wrongLoggingFormatError struct{}
const wrongLoggingFormatErrorMessage = "Accepted value for logging format: text, json"
func (e *wrongLoggingFormatError) Error() string {
return "Accepted value for logging format: text, json"
return wrongLoggingFormatErrorMessage
}
// getLoggingLevelFromFileConfig returns a logrus Formatter if a matching was found