Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
}
}
- # XXX - add check for validating the configured loglevel.
+ # Gather details about supported log levels.
+ my %supported_loglevels = &Guardian::Logger::GetLogLevels();
+
+ # Check if the configured log level is valid.
+ unless (exists ($supported_loglevels{$config{LogLevel}})) {
+ return "Invalid LogLevel: $config{LogLevel}";
+ }
# The config looks good, so return nothing (no error message).
return undef
## This really simple function just returns the hash which
## contains all supported log levels.
#
-sub LogLevels () {
+sub GetLogLevels () {
# Nothing to do, just return the loglevels hash.
return %loglevels;
}