Unverified Commit 86f52910 by Christian Brauner Committed by Stéphane Graber

confile: config_loglevel()

parent 666f0f45
...@@ -1404,17 +1404,23 @@ static int config_loglevel(const char *key, const char *value, ...@@ -1404,17 +1404,23 @@ static int config_loglevel(const char *key, const char *value,
{ {
int newlevel; int newlevel;
if (config_value_empty(value)) /* Set config value to default. */
if (config_value_empty(value)) {
lxc_conf->loglevel = LXC_LOG_PRIORITY_NOTSET;
return 0; return 0;
}
/* Parse new config value. */
if (value[0] >= '0' && value[0] <= '9') { if (value[0] >= '0' && value[0] <= '9') {
if (lxc_safe_int(value, &newlevel) < 0) if (lxc_safe_int(value, &newlevel) < 0)
return -1; return -1;
} else { } else {
newlevel = lxc_log_priority_to_int(value); newlevel = lxc_log_priority_to_int(value);
} }
// store these values in the lxc_conf, and then try to set for
// actual current logging. /* store these values in the lxc_conf, and then try to set for actual
* current logging.
*/
lxc_conf->loglevel = newlevel; lxc_conf->loglevel = newlevel;
return lxc_log_set_level(&lxc_conf->loglevel, newlevel); return lxc_log_set_level(&lxc_conf->loglevel, newlevel);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment