mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
8a12af97ab
This removes the deprecated logging, host, port, and tls options per our deprecation policy.
25 lines
737 B
Go
25 lines
737 B
Go
package validator
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
|
|
"github.com/authelia/authelia/v4/internal/configuration/schema"
|
|
"github.com/authelia/authelia/v4/internal/utils"
|
|
)
|
|
|
|
// ValidateLogging validates the logging configuration.
|
|
func ValidateLogging(configuration *schema.Configuration, validator *schema.StructValidator) {
|
|
if configuration.Log.Level == "" {
|
|
configuration.Log.Level = schema.DefaultLoggingConfiguration.Level
|
|
}
|
|
|
|
if configuration.Log.Format == "" {
|
|
configuration.Log.Format = schema.DefaultLoggingConfiguration.Format
|
|
}
|
|
|
|
if !utils.IsStringInSlice(configuration.Log.Level, validLoggingLevels) {
|
|
validator.Push(fmt.Errorf(errFmtLoggingLevelInvalid, configuration.Log.Level, strings.Join(validLoggingLevels, ", ")))
|
|
}
|
|
}
|