config/Option: convert to strictly-typed enum

This commit is contained in:
Max Kellermann
2015-01-21 22:36:13 +01:00
parent 10972da060
commit 1c3f5517fa
36 changed files with 153 additions and 132 deletions

View File

@@ -139,14 +139,14 @@ log_init(bool verbose, bool use_stdout, Error &error)
if (verbose)
SetLogThreshold(LogLevel::DEBUG);
else if ((param = config_get_param(CONF_LOG_LEVEL)) != nullptr)
else if ((param = config_get_param(ConfigOption::LOG_LEVEL)) != nullptr)
SetLogThreshold(parse_log_level(param->value.c_str(),
param->line));
if (use_stdout) {
return true;
} else {
param = config_get_param(CONF_LOG_FILE);
param = config_get_param(ConfigOption::LOG_FILE);
if (param == nullptr) {
#ifdef HAVE_SYSLOG
/* no configuration: default to syslog (if
@@ -164,7 +164,7 @@ log_init(bool verbose, bool use_stdout, Error &error)
return true;
#endif
} else {
out_path = config_get_path(CONF_LOG_FILE, error);
out_path = config_get_path(ConfigOption::LOG_FILE, error);
return !out_path.IsNull() &&
log_init_file(param->line, error);
}